Bug reading file as UTF-8? [Was: Reading file containing UTF-8]
Bug reading file as UTF-8? [Was: Reading file containing UTF-8]
- Subject: Bug reading file as UTF-8? [Was: Reading file containing UTF-8]
- From: Tom Robinson <email@hidden>
- Date: Thu, 06 Nov 2003 20:11:13 +1300
Hi folks,
I'm wanting to read a file which contains UTF-8 into a UTF-8 string (or Unicode).
The following code works right up until I add the 'until linefeed':
property somefile : alias ((path to desktop as text) & "small.txt")
property linefeed : ASCII character 10 -- Unix
set a to read somefile as <<class utf8>> -- until linefeed
log "*** " & a
log class of a
The file contains an en-dash (option-hyphen). Without the 'until linefeed' it looks fine in the event log. With the 'until linefeed' the 3 bytes representing the em-dash never get converted.
Clues and workarounds appreciated!
OS X 10.3.
Cheers
(Thanks to jj).
--
Women DO come with instructions. Just ask them!
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.