How to use readText to read utf16 file?

Domain via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 16 18:50:42 PST 2015


On Tuesday, 17 November 2015 at 02:42:29 UTC, Adam D. Ruppe wrote:
> On Tuesday, 17 November 2015 at 02:40:14 UTC, Domain wrote:
>> How to use readText to read utf16 file?
>
> readText!wstring("filename")
>
> should do it for utf16. It will return a wstring, which is 
> utf-16.
>
> You can do utf32 with readText!dstring. The default, of course, 
> is string, which is utf8.
>
> It doesn't support conversions or any other encoding.

Thanks! But how to remove BOM? Slice the result myself?


More information about the Digitalmars-d-learn mailing list