Problem with url-encoding moving from floatbox 503 to 601

Page: 1

Author Post
Member
Registered: Apr 2014
Posts: 1
Hi there,

i have some strange effect, switching from floatbox-5.0.3 to floatbox-6.0.1 (as far as i can see, the problem is only on IE9, not on Firefox):

within the floatbox i set a href to an url which contains url-encoded parameters (...Flughafen%20M%FCnchen%20Terminal%202%20Bereich%20H...)

Running on floatbox-5.0.3 everything works fine, but floatbox-6.0.1 does some "creative recoding" before sending the request.

See an example here:
http://www.munich-airport.de/de/consumer/fluginfo/detail/index.jsp?knr=426300

At the bottom of the page, the button "Weiter zur Fahrplanauskunft" holds the url-encoded parameters, but when clicking the button, the parameters sent to the destination are changed.

right: ...Flughafen%20M%FCnchen%20Terminal%202%20Bereich%20H
wrong: ...Flughafen%2520M%25FCnchen%2520Terminal%25202%2520Bereich%2520H

Look at the second blue box heading "Start"

As i mentioned, with floatbox 5.0.3 everything worked fine and opening the link in a new tab/window works too.

Any ideas?

Thanks,

Chris
Administrator
Registered: Aug 2008
Posts: 3382
Aah, the dark mysteries of encoding.

The basic problem is that you're using the wrong encoding. The href is an HTML attribute. It needs to be HTML-encoded for proper interpretation by HTML parsers. You are using URL encoding and experiencing the precise reason why you should not do so - different browsers will parse it out in different ways. Use proper HTML encoding and the browser will generate the proper URL encoding for you when it does the fetch.

So, for example, where you have:
"xyz?Flughafen%20M%FCnchen%20Terminal%202%20Bereich%20H"
you should have:
"xyz?Flughafen München Terminal 2 Bereich H"
If you're not comfortable with the spaces, you could HTML-encode them with ampersand-hash-32-semicolon. (The forum software will not allow direct entry of numeric HTML encodes.)

Using this format will cause browsers to fetch
xyz?Flughafen+M%C3%BCnchen+Terminal+2+Bereich+H=

Notice that your attempt at manual URL encoding is incorrect in the details as well as the strategy. The spaces become "+" and not "%20", and URLs use the UTF-8 character set where the "ü" character (ü) gets encoded as "%C3%BC".

Page: 1