d - how to decode ubyte[] to a specified encoding? -
the problem is: how parse file when encoding set @ runtime?
encoding be: utf-8, utf-16, latin1 or other
the goal convert ubyte[] string selected encoding. because when use std.stdio.file.bychunk or std.mmfile.mmfile have ubyte[] data.
are trying convert text file utf-8? if answer 'yes', phobos have function specialy this: @trusted string toutf8(in char[] s)
. see http://dlang.org/phobos/std_utf.html details.
sorry if not need.
Comments
Post a Comment