470,855 Members | 1,270 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

Mysterious missing newlines ...

Hi,

So I'm having a problem with disappearing newlines. I import the
newlines from a file into my shell script fine. But then I process the
text and the url_encode comes out the other end with linefeeds intact
but no newlines.

Also any single quotes in my file give me a T_STRING unexpected error
in my output ... even though I'm using rawurlencode(). I've tried
escaping them in my text but no luck there.
I can live without the single quotes, but I need newlines in my output.

URL="`cat job_description`"

URL_ENCODED_DESCRIPTION=`php -r "echo rawurlencode('$URL');"`

.... the single quotes works fine - the php function returns a value -
so that's not a problem.

Can anyone help me get a urlencoded string with newlines intact ?
Otherwise I'm just left with a lump of text.
Also I can't use <br> or \n in my output because my message board won't
parse them ... :-)

Feb 27 '06 #1
1 1625
dbee wrote:
Hi,

So I'm having a problem with disappearing newlines. I import the
newlines from a file into my shell script fine. But then I process the
text and the url_encode comes out the other end with linefeeds intact
but no newlines.

Also any single quotes in my file give me a T_STRING unexpected error
in my output ... even though I'm using rawurlencode(). I've tried
escaping them in my text but no luck there.
I can live without the single quotes, but I need newlines in my output.

URL="`cat job_description`"

URL_ENCODED_DESCRIPTION=`php -r "echo rawurlencode('$URL');"`

... the single quotes works fine - the php function returns a value -
so that's not a problem.

Can anyone help me get a urlencoded string with newlines intact ?
Otherwise I'm just left with a lump of text.
Also I can't use <br> or \n in my output because my message board won't
parse them ... :-)


I think I answered something like this before. My suggestion was to
simply encode newlines using your own method. Make some escape key that
would act as a newline.

Carl

--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
Feb 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Christopher Finke | last post: by
28 posts views Thread by Glenn Alcott | last post: by
4 posts views Thread by Psibur | last post: by
2 posts views Thread by Edward K. Ream | last post: by
8 posts views Thread by Elijah Cardon | last post: by
4 posts views Thread by lihao0129 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.