Home Forums General XMetaL Discussion xml property of ActiveDocument object and UTF-8 Reply To: xml property of ActiveDocument object and UTF-8

Derek Read

Reply to: xml property of ActiveDocument object and UTF-8

I'll try your script. My testing shows that JScript thinks the values are (in decimal) 8220 and 8221, which is correct. It also specifically does not find the values 93 or 94 (not sure if those were hex or decimal so I'm checking both). [Sorry, I wrote it in JScript before I saw your VBScript]

Here's my test script:

[code]//XMetaL Script Language JScript:
//run on any document containing “smart quotes”
//best to run on a document with only two of them
var x = ActiveDocument.xml;
Application.Alert(x);
for(i=0;i var c = x.charCodeAt(i);
if (c == 93) {
Application.Alert(“Found a U+005D (dec 93) at offset:” + i);
}
else if (c == 94) {
Application.Alert(“Found a U+005E (dec 94) at offset:” + i);
}
else if (c == 147) {
Application.Alert(“Found a U+0094 (dec 147) at offset:” + i);
}
else if (c == 148) {
Application.Alert(“Found a U+0094 (dec 148) at offset:” + i);
}
else if (c == 8220) { //left double quotation mark
Application.Alert(“found U+201C (dec 8220) at offset:” + i);
}
else if (c == 8221) { //left double quotation mark
Application.Alert(“found U+201D (dec 8221) at offset:” + i);
}
}[/code]

Reply

Products
Downloads
Support