Hi,
I have a fix for an unusual behaviour in Logo/Cobra regarding unencoded urls in an a.href element: if they have a link containing spaces, tabs or newlines in Lobo, it will keep them in the URL. Usually this will cause a 'Bad Request' response from the server. Real-life example: the "24h TV-Rückblick" link on QVC.de contains spaces. There are also links with tabs on QVC.de ("Beauty"/"Dekorative Kosmetik").
For compatibility with other browsers (Firefox and IE in particular), it should encode spaces automatically, and remove tabs and newlines from the URL.
I have prepared a test page at http://zwangsdigitalisierung.de/test-a-encoding.html that lets you experiment with character encoding in links. While doing this, I noticed a two differences between Firefox 3 and IE 7:
1. Firefox does not only encode spaces, but also various other illegal characters. IE only encodes spaces.
2. If you have a a.href containing illegal characters and then read it using Javascript, Firefox will return the encoded URL and IE will return the unencoded. However, when clicking at a link, both browsers will always go to the encoded URL.
I wasn't sure whether to take the Firefox or the IE way, so I decided for the latter, because its solution seems cleaner. If you don't agree with this, I'd be willing to rewrite the patch, of course. Also interesting would be any standard / site which deals with interoperability issues like that and gives advice which way to go.
To summarize it, this patch will:
1. Make sure that HTMLLinkElement.href filters control characters (code < 32) when being read (but not spaces)
2. Encode spaces for all links in NodeImpl.getURL()
(The reason why control characters are removed at a different place than spaces is to imitate IE's behaviour - when a.href is being read, IE removes control characters but no spaces)
Oh, and it's my first patch in Lobo/Cobra, so please be gentle :)
Tim
Patch for Logo/Cobra HEAD