• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Bug reading file as UTF-8? [Was: Reading file containing UTF-8]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Reading file containing UTF-8 (From: julifos <email@hidden>)

  • Prev by Date: Re: Escape Apostrophes in 'Do Shell Script'
  • Next by Date: Re: Entourage -> rule -> attachments
  • Previous by thread: Re: Reading file containing UTF-8
  • Next by thread: how to access the folder/directory popup button in the nav dialog
  • Index(es):
    • Date
    • Thread