--- Jake <[EMAIL PROTECTED]>
wrote:
> 
> On my machine (linux) if I dump textarea input to a
> ascii text file like so...
> 
> my $ta = $query->param('myTextArea');
> print outFile $ta;
> 
> newlines are saved as cr/lf which corresponds to the
> hex characters 0D and 0A.  
>
> ... [snip stuff about end of lines] ...
>

Yes, I know about end-of-lines on different systems,
and in fact I have already verified that I was getting
0D/0A combinations from the textarea, but I wasn't
sure if that was just because I'm using ActiveState on
a Windows machine. Thanks your relating your results.

> anyway, my point would be that maybe it's better to
> test for the hex codes 0D 
> and 0A instead of looking for '^'s and such...then
> replace them with a <br>, 
> and do the reverse when you want to send the info
> back to a text area.

That's a good idea. 

> I dont know how to test against the hex codes
> though...anybody?

According to the handy O'Reilly Perl 5 Pocket
Reference (highly recommended), "Patterns are
processed as double-quoted strings, so standard string
escapes (see page 7) have their usual meaning." On
page 7, we are reminded of "\xdd" where "dd" is a
two-digit hex number, such as "\x0d" or "\x0a". Or
maybe even just "\n" would suffice. So I'll try those
tomorrow (it's bedtime now) and let you know what I
come up with.

> Also, you confused me a bit, I'm assuming that at
> some point you want to 
> display the textarea input in a webpage but not
> necessarily inside another 
> textarea.  If you are only saving from and loading
> into textareas, you would 
> never need <br>s or <p>s
> 
> what im thinking of is if someone enters ...
> 
> Hello:
> my name is 
> Bobby
> 
> ...in your textarea, you want to save this to a file
> and then generate a web 
> page from it that will display
> 
> Hello:
> my name is
> Bobby
> 
> and not..
> 
> Hello:my name is Bobby
> 
> is this what you're trying to do or am I way off
> base?

You are exactly right. Sorry if I was vague, I was
trying to find the balance between enough information
and too much. I will be storing the text as records in
a CSV file, for later display on a page *or*
re-editing in a textarea by authors. I'll save it with
the HTML tags, since I can't keep the newlines in a
CSV file record anyway, and just convert it back into
newlines when needed to put back in a textarea for
further editing.

Thanks!


=====
"When you're following an angel, does it mean you have to throw your body off a 
building?" - They Might Be Giants, http://www.tmbg.com
----
Word of the week: Serendipity, see http://www.bartleby.com/61/93/S0279300.html

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to