Is there a native function to detect if file is UTF encoding?

Dejan Lekic via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 22 07:03:03 PDT 2014


On Friday, 22 August 2014 at 13:53:04 UTC, MacAsm wrote:
> To call decode() from std.encoding I need to make sure it is an 
> UTF (may ne ASCII too) otherwise is will skyp over ASCII 
> values. Is there any D native for it or I need to check byte 
> order mark and write one myself?

You may want to take a look at 
http://dlang.org/phobos/std_stream.html#.EndianStream.readBOM . 
Note that this module is scheduled for depreciation...


More information about the Digitalmars-d mailing list