Archive: Xml & Utf-16


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


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


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


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


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


Hit gold, with this:
http://scripts.sil.org/cms/scripts/p...&cat_id=TECkit

Stu


[deleted]