Sorry, OT but its driving me nuts.

I've indexed a document with chinese characters in its title. When I perform the search (that returns json) I get back the title and using Javascript place it into a variable that ultimately ends up as a dropdown of titles to choose from. The problem is the title contains the literal unicode representation of the chinese characters (中 for example).

Here's the javascript:

     var optionObj=document.createElement('option');

     menuItem=titleArray[1].title;
     menuVal=titleArray[1].url;

     if((menuItem != " ")&&(menuItem != "")&&(menuItem != null))
      {
       optionObj.appendChild(document.createTextNode(menuItem));
       optionObj.setAttribute('id',"optId" + optCnt);
       optionObj.setAttribute('target',"_blank");
       optionObj.setAttribute('value',menuVal);
       optCnt++;
       selectObj.appendChild(optionObj);
      }

My hunch is I should utf-8 encode the title and then try and display the result but its nor working. I still am seeing the unicode characters.

Does anyone see what I could be doing wrong?

TIA - Tod

Reply via email to