Topic: Strange reencoding of gallery xml path


In short, if I use a path with %-encoded characters in the gallery xml path, these characters get incorrectly reencoded.

Here's what happens in more detail.

In my HTML file, I use swfobject. I include this line:
flashvars.galleryURL = "./files/2009/Gala%20M%C3%A9ritas/gallery.xml";

This contains a space (%20), and an "e" with acute accent encoded in utf-8 and then %-encoded (%C3%A9).

swfobject is generating correctly the HTML, which I did verify with Firefox web developer tools (View generated source function). It is adding a proper:
<param value="galleryURL=./files/2009/Gala%20M%C3%A9ritas/gallery.xml" name="flashvars">

Note the %-encoded characters are unchanged, as expected.

When Simple Viewer starts, you would expect it to make an HTTP query to that url. Actually, sniffing the traffic shows it instead does this request:

GET /~pmf/archives_photo/files/2009/Gala%20M%E9ritas/gallery.xml HTTP/1.1\r\n

As you can see, the %C3%A9 was changed to %E9. This means Simple Viewer, %-decoded the string, applied a conversion from UTF-8 to ISO-8859-1 (latin1), and then %-reencoded it.

Of course the result is a 404 Not Found and a "Gallery XML Not Found" message from the Flash app.

It is very strange to convert %-encoded characters in this way, as there is no reason to assume these values represent utf-8 characters. They could be raw data of any kind. I can find no reference in the HTTP 1.1 standard or in RFC3986 that allow such a conversion of the url.

Any thoughts?