For internal test reporting, I created an HTML file that renders data onto the screen that is loaded through the JQuery Get method. The test data is in JSON format.
The problem I have is that data that contains diacritic characters (ï, ô, à etc.) isn’t rendered correctly. This data string: <{[Spécïàl Châr's!@&]> is rendered into my reporting as <{[Sp��Ch�s!@&]>. The original string in the text file is correct displayed in notepad++.
Flow:
- VBScript is creating a textfile through the filesystemobject,
CreateTextFile method. - The txt file containing JSON strings is read
by JQuery $.get into an array of JSON strings - Each JSON string is parsed by JQuery $.parseJSON into javascript objects
- The objects are processed by JQuery to create a nice view
The HTML file where the data is rendered has the following meta data:
<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=8; charset=UTF-8"/>
I already tried to change the doctype into W3C doctypes, the content attribute to ‘text/html’ variants and the charset attribute to ‘ISO-8859-1’ variants but nothing seems to render my data correctly.
Could someone please give me a hint what I could do to detect in what part the problem resides?
Just shooting in the dark here. Are you sure you have a unicode text file? Default encoding seems to be ASCII.
http://www.devguru.com/technologies/vbscript/quickref/filesystemobject_createtextfile.html