how to tell whether external file is unicode formatted or not

Mark Schonewille m.schonewille at economy-x-talk.com
Mon Dec 21 04:53:23 EST 2009


Curt,

The default way is to show an open-file dialog, asking the user to  
choose the file and select an option from a menu with encodings.

You can use unicode signatures to determine the encoding, but UTF8  
doesn't need a signature officially and UTF16 files may not have the  
signature either. Here's some information about unicode BOM signatures  
<http://unicode.org/faq/utf_bom.html#BOM>.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Full PayPal integration and automation in web site or (Revolution/ 
SuperCard/other) software. Contact me for a quote before 1 Jan 2010  
and we'll charge (reduced) 2009 prices.
http://economy-x-talk.com/contact.html

Op 21 dec 2009, om 03:41 heeft Curt Ford het volgende geschreven:

> My app reads in external files that are stored as plain text, but  
> the encoding can vary. Is there a way to tell whether the encoding  
> is Unicode or not, so I can tell how to process the text (without  
> asking the user, who may not know)?
>
> thanks,
>
> Curt
>
>
> Curt Ford
> Sona Software LLC
> www.sonasoftware.com
>




More information about the use-livecode mailing list