使用PHP的IE和GET请求的Utf8问题

Using javascript, I'm setting the src of an iframe to an URL passing a GET variable, urlencoded with unescape( encodeURIComponent( message ) ).

With IE, this works the first time I load the iframe.The utf-8 characters, as the var_dump($_GET) reveals server-side, are okay. But next calls, all I get is garbage.

On the other hand, if I just send in the message variable, without any escaping, the first time I set the iframe, the var_dump($_GET) shows the characters are wrong. But next calls, the variable is correctly set!!

Any idea of whats going on?

Do the following:

  1. Use these JS functions for encoding / decoding your string to / from UTF8.

  2. Save your code files with UTF8 without BOM encoding using any advanced text-editor / IDE like Notepad++.