character problem with UTF-8

hi again,

i have a script that replaces certain parts in the HTML files that iweb publishes. they are in UTF-8.

as soon as run the script, and later look at the html page, all the non standard characters like ÄÖÜß& are fucked up.

i have tried adding the «as class UTF-8» thing at the end when the file gets written, but it aint solving it :frowning:

any ideas?


I just tried it with this, and it worked perfectly - I created a simple page with an ellipsis in it, then read the page and the ellipsis was there in my variable, then wrote it back out and looked at it and the ellipsis was still there:

set T to read alias "ACB-G5_1:Users:bellac:Desktop:Site 2:Blog:Blog.html" as «class utf8»

set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to "ellipsis"
set C to characters 1 thru 4 of text item 2 of T
set AppleScript's text item delimiters to tid
set N to open for access ((path to desktop folder as text) & "out.txt") with write permission
set eof of N to 0
write T to N as «class utf8»
close access N

I’ve never seen that before. Did you mean:

as «class utf8»

bruce - that was a typing mistake :smiley:

adam - thanks. i just added the as class thing at the wrong spot