[Tutor] encode

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed Apr 19 07:14:56 CEST 2006



On Wed, 19 Apr 2006, kakada wrote:

> I wonder if we can check the encoding of text in one text file. user is 
> free to encode the file whether Latin1, utf-8, ANSI...

In the general case, this is difficult, and "solving" it might be worse 
than not.  See:

     http://www.joelonsoftware.com/articles/Unicode.html

It is much better if you don't have to guess the file type: that's exactly 
the point of adding "document type" metadata to a document.  If you can 
explain your situation more more --- why you're guessing document types 
--- we might be able to offer a different approach.

Best of wishes to you!


More information about the Tutor mailing list