I have a web page, and that web page has a JavaScript saved in another file, that is loaded into the web page. When webpage is loaded, JavaScript will create a table, and then it will output something into the cells of the table.
However, when I want to output Chinese Character like: "你好"。 Things screwed up, like this: ��������
How do I solve this problem so I can output the Chinese character?
Figure out where the problem come from: I load strings from text file, and those strings will be output to table. And those strings, if are Chinese, are turned into question marks.
Trying Unicode:
Code where I get problematic strings:
function get_Audio_List()
{
$.get(list_File, function(data, status){
// Debug Output..
( (DEBUG) ? alert("DEBUG: Data: \n" + data + "\nStatus: " + status) : (null) );
// Get Data..
audio_List = new String (data);
// Log to Console..
( (LOG) ? console.log("Audio List: Loaded") : (null) );
});
}
Note the Dialog Box shown by 'alert' function also shows Question Marks like the one I posted. However, if I 'alert' a Chinese Text by giving its Chinese character directly like: alert("编码");
. It works fine, and I think that's what you interpreted.