Note that there are some explanatory texts on larger screens.

plurals
  1. POURL Escaping Chinese/Japanese Unicode Characters for Internet Explorer
    text
    copied!<p>I'm trying to URL-escape (percent-encode) non-ascii characters in several URLs I'm dealing with. I'm working with a flash application that loads resources like images and sound clips from these URLs. Since the filenames can contain non-ascii characters, like so: <code>日本語.jpg</code> I escape them by utf-8 encoding the characters, and then percent-escaping the unicode bytes, to get the following:</p> <p><code>%E6%97%A5%E6%9C%AC%E8%AA%9E.jpg</code></p> <p>These filenames work fine when I run the app in any browser other than Internet Explorer - I've tried Firefox, Safari and Chrome. But when I launch the app in IE (tried both 6 and 8) and it tries to load the sound clip, I get: <code>Error #2044: Unhandled ioError</code>, and the URL has been corrupted to something like:</p> <p><code>æ¥æ¬èª.jpg</code></p> <p>Any thoughts on how to fix this? This is just test-driving the flash app with local filesystem URLs. I've also noticed that Internet explorer isn't able to locate a file such as: <code>file:///C:/%E6%97%A5%E6%9C%AC%E8%AA%9E.jpg</code>, though Chrome / Firefox will decode it and load just fine for a file with the path</p> <p><code>C:\日本語.jpg</code></p> <p><em>edit</em></p> <p>I think my problem is the same as the one encountered in the following ActionScript code fragment:</p> <pre><code>import flash.display.Loader; import flash.net.URLRequest; ... var ldr:Loader; var req:URLRequest = new URLRequest("日本語.jpg"); ldr = new Loader(); ldr.load(req); </code></pre> <p>Using the string <code>日本語.jpg</code> will work in IE, while using the string <code>%E6%97%A5%E6%9C%AC%E8%AA%9E.jpg</code> works in other browsers. What I need is a single form that will work in all browsers. I have tried the <code>%u</code> encoding and setting the http request header to <code>Content-Type: text/html; charset=utf-8</code> with no luck in either percent-escaped or unescaped form.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload