473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1776
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Christopher Finke | last post by:
I have a site wherein the clients can update the individual pages by editing the text of that page in a <textarea>. Then, when the page is displayed, all of the newlines (\n) are converted to HTML...
2
by: M Wells | last post by:
Hi All, I'm trying to track down a mysterious problem we're experiencing in which updates and inserts to tables in our mssql2k server appear to be 'disappearing.' To explain our situation: ...
28
by: Glenn Alcott | last post by:
On a page I am working on which has three graphic buttons, there is a small line between two of the buttons which links to the same page as one of the buttons. I have no idea how this line got in...
4
by: Psibur | last post by:
Hello, trying to get back into c and was having issue with reading a simple text file with an aribtrary # of lines with 3 int's per line, with the eventual purpose of putting each int into an...
2
by: Edward K. Ream | last post by:
Hello all, I recently ran across a situation in which sax.saxutils.quoteattr did not work as I expected. I am writing Leo outlines as opml files http://en.wikipedia.org/wiki/OPML which forces...
2
by: Fred Dag | last post by:
Hi, When writing using both these methods ( StreamWriter.Write("\n") vs WriteLine() ) to a file and open in Notepad I see a special character instead of newlines with Write("\n") vs a newline...
8
by: Elijah Cardon | last post by:
1 1 1 1 1 1 2 2 2 1 1 1 3 3 3 1 1 1 4 4 1 2 1 1 5 5 2 2 1 1 6 6 3 2 1 1 7...
4
by: lihao0129 | last post by:
Hi, folks: I recently went through a strange problem with my Javascript code, say: I have a string variable which are from a 'textarea' element and I want to remove the trailing newlines inside...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.