How to know whether a file's encoding is ansi or utf8?

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 24 03:29:13 PDT 2014


I first try to load the file as utf8 (or some 8kb at the start of 
it) with encoding exceptions turned on, if I catch an exception, 
I reload it as ansi, otherwise I assume it's valid utf8.


More information about the Digitalmars-d-learn mailing list