473,804 Members | 3,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_DES CRIPTION=`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 1807
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_DES CRIPTION=`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
4570
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 line breaks (<br />). However, I have come across some instances where I do not want to convert the newlines, such as the following: <table> <tr> .... </tr>
2
1779
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: We have a web page (written in ASP, if that's relevant) on which we accept enrollment information.
28
2475
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 there and would appreciate anyone checking it out for a clue that I may be missing. The page is at http://www.ultimateinsurancejobs.com/test2/login1.asp The line is between the Register and Lost Password buttons, and links to the same page as the...
4
3062
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 element of an array (eventually will be other things, but I'm sticking to int's for now). I.e.: 0 1 1 1 1 1 2 1 1 etc... The problem is it'll read and print all but the last line. Is there
2
1997
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 me to write python code in xml attributes rather than xml elements (as is done in .leo files). The problem is that the sax parser I am using ignores newlines in attributes. After reading the thread at:
2
33977
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 with WriteLine(). How do I insert characters into a string ( ie "line 1\nline 2\n" ) so that when I write them to Stream they will be interpreted properly as newlines? Thanks in advance
8
2131
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 7 1 3 1 1 8 8 2 3 1 1 9 9 3 3 1 1 10 10 1 1 2 1
4
22356
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 the string. I am using something like the following: var txt = textarea_element.value.replace(/\n*$/, ''); But this replaced only the last newline(by changing '' to 'K', and
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.