tags:

views:

35

answers:

1

Hey there!

I'm having a bit of trouble here and I was hoping someone throws me a hint :)

I'm getting some GET VARS with JS but I have trouble with non-latin charsets: cyrillic for example. The cyrillic var appears correct in the url but when I retrieve it with JS I get some dummy string.

I was wondering of a function similar to "unescape" for such a case.

Alternatively, if someone knows a way I could convert a cyrillic string to the same dummy string I get from the URL, it will still do me the trick, since all I need is compare.

:) Thanks! Martin

+2  A: 

For handling URI parts, I recommend you to use the encodeURIComponent / decodeURIComponent functions.

decodeURIComponent("%D0%B0%D0%B1%D0%B2%D0%98"); // "абвИ"
encodeURIComponent("абвИ"); // "%D0%B0%D0%B1%D0%B2"
CMS