views:

111

answers:

2

I have the following code:

var words = new Object(); 

$("li.words").each(function(){
   var thisId = $(this).attr("id");
   words[thisId] = $(this).children('input#word').val();
});

The input with id #word contains words in Hebrew (i.e. UTF-8 chars). When I use:

alert($.param(words));

the words look like this: %D7%9E%D7%AA%D7%A7%D7%93%D7%9E%, instead of Hebrew characters.

This is weird, because if I try to alert a Hebrew word like so:

alert('עברית'); 

it works just fine. Even if I use a variable and alert it (without $.param).

A: 

How about using unescape function. It decodes such chars as far as i can remember.

Sarfraz
A: 

OK, I'm stupid.

the solution was:

alert(decodeURI($.param(grpNames_he)));

I just used it wrong a couple of times and thought I was going crazy.

Adam