 |
Author |
Topic: param(s) strips carriage returns? (Read 1523 times) |
|
kirkjerk

|
param(s) strips carriage returns?
« on: Mar 27th, 2005, 7:38pm » |
|
Dealing with the interaction of HTML and applets... this might be a general java applet issue, not processing specific, but it seems like carriage returns are being unceremoniously dropped from the value parameter of <param> tags when I try to read the value with param(). Is there a justification for this annoying behavior? Like, according to some xml-ish definition of HTML, carriage returns are illegal or ignorable in side tag parameters? Is there a common workaround? For now I guess I'll use a lesser used character like ~ or ` or | to stand for returns, and whip up a boolean isEndlineCharacter(char c) function to abstract it out. Pretty annoying!
|
|
|
|
fry
|
Re: param(s) strips carriage returns?
« Reply #1 on: Mar 27th, 2005, 11:03pm » |
|
html is whitespace agnostic. to encode return characters you probably should url encode them--ie a return or newline becomes %0A or %0D (i believe) and spaces are %20. and if they're not decoded by java automatically (param() is just java.applet.Applet.getParameter() wrapped up), then you can use java's URLDecoder class.
|
|
|
|
kirkjerk

|
Re: param(s) strips carriage returns?
« Reply #2 on: Mar 28th, 2005, 4:21pm » |
|
I'd say this goes beyond whitespace agnostic...more like whitespace antagonistic, because it just ignores it. Regularly parsed HTML doesn't recognize different types or quanities of whitespace, but does seem to differentiate between some whitespace and no whitespace at all. Yeah, I did try getParameter() natively and it was the same result, so I figured it wasn't done in processing proper.
|
|
|
|
|