Afrow UK
27th July 2007 20:04 UTC
Xml & Utf-16
I've tried Instructor's XML plug-in and it does not support XML files encoded in UTF-16. I'm not particularly on the ball with this, so does anyone know of a way to modify the file?
I seem to be able to read bytes from it that are readable characters but writing to it is another matter using FileWriteByte.
Stu
demiller9
27th July 2007 21:46 UTC
If the characters all map into 8 bit characters, you can use Notepad to convert from 16 bit unicode to ansi. Change the encoding dropdown in the file-save dialog to convert the file.
Don
Afrow UK
27th July 2007 22:12 UTC
Sorry, should have said, this needs to be done at run-time automatically. I've found some programs to convert from UTF-16 to UTF-8 but they aren't working under nsExec for some reason. Still testing.
The scenario:
Convert UTF-16 file to UTF-8.
Modify it with the XML plug-in.
Convert it back to UTF-16.
Stu
Afrow UK
27th July 2007 23:33 UTC
I ended up using NSIS FileOpen, FileRead, FileWrite and FileClose to make my changes to the XML file! The XML plug-in seems to lack some of the features/functions that DOM manipulation in JavaScript has.
Stu
Afrow UK
28th July 2007 00:32 UTC
Still not working correctly. The command-line tool converts it to UTF-16 BE when it needs to be UTF-16 only. The program that uses the XML file now crashes!
Stu
Afrow UK
28th July 2007 01:17 UTC
Hit gold, with this:
http://scripts.sil.org/cms/scripts/p...&cat_id=TECkit
Stu
Instructor
28th July 2007 06:04 UTC
[deleted]