xml encoding through ps scripts

Upload Adobe Bridge Scripts, Download Adobe Bridge Scripts, Support for Individual Adobe Bridge Scripts

Moderators: Tom, Kukurykus

csuebele

xml encoding through ps scripts

Post by csuebele »

I wrote a script that sizes photos then creates an xml file to use in Flash. Everything works great unless one of my galleries has a lot of images. then if Firefox is used, Flash will load all the thumbnails and hang up on the large image. I can fix this if I set the firefox browser to encode western (ISO-8859-1) It will not work with UTF-8. My XML file has a declaration line stating it's using UTF-8. Is the ps script encoding the file differently when the file is written?
xbytor

xml encoding through ps scripts

Post by xbytor »

One that should work is this:

file.encoding = "UTF8";
file.open("w", "TEXT", "????");
// unicode signature, this is UTF16 but will convert to UTF8 "EF BB BF"
file.write("\uFEFF");
file.lineFeed = "unix";
file.write(xml.toXMLString());


You may not need the \uFEFF part, but everything is is required.

-X
csuebele

xml encoding through ps scripts

Post by csuebele »

xbytor wrote:One that should work is this:

file.encoding = "UTF8";
file.open("w", "TEXT", "????");
// unicode signature, this is UTF16 but will convert to UTF8 "EF BB BF"
file.write("\uFEFF");
file.lineFeed = "unix";
file.write(xml.toXMLString());


You may not need the \uFEFF part, but everything is is required.

-X

Thanks! I figured it was somehow the way ps-scripts wrote the file, but didn't know how to correct it.