|
|
|
|
#1 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
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 |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 462
|
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 |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
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 |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
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 |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
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 |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
|
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Jul 2004
Posts: 671
|
[deleted]
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|