Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing to file as UTF8 with BOM ?



Sander Tekelenburg wrote:
in the name of the file for ex part of the extension.

File name extensions aren't appropriate for this sort of thing.
yes i agree with your point.

[...] i've an app where i have to guess encoding [of the input -st]

That sucks. Some apps can guess the encoding for you, so maybe one of the gods in this list can even tell you how to do that from within AS (I'm sure it will require some do shell script call). But it would still be a guess. IMO the only way to be sure is for whoever gives you the file to tell you what encoding applies -- assuming they even know...


for the time being y've done that using regexp first : i wipe out all html tags.

aferwards i look if it is the simplest case, that's to say ascci, a more advance case : UTF-8

up to here everything works very well.


then i look for all the iso and cp dialects using enca (by do shell script) where i do have coples of (encoding, language) text files (obviously i don't have all the encodings for all the languages of the world))) resulting in the most probable cople in my coples set.


when enca say "not found" y assume it is "iso-8859-1" and log an error message.

i'de like to go further working with UTF-16 to enable working with asian "character" set (I'm an anciant chinese reader).

best,

Yvon

ps, is applescript utf-16-able ???
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Writing to file as UTF8 with BOM ? (From: Richard Rönnbäck <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: "Mark J. Reed" <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Yvon Thoraval <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: "Mark J. Reed" <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Yvon Thoraval <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: "Mark J. Reed" <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Yvon Thoraval <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Emmanuel <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Yvon Thoraval <email@hidden>)
 >Re: Writing to file as UTF8 with BOM ? (From: Sander Tekelenburg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.