reading UTF-8 formated file into dynamic array

thofis thofis at
Tue Jul 24 08:19:50 PDT 2007


I try to read a text file into a dynamic array but got stucked with non
ASCII characters. While trying I looked at the word count example.

Basicly there's used:
char[] input;
// read file into input[]
input = cast(char[])[i]);

But it seems that this casting does not result in proper filling of
_input_. Any non ACSII character is splited into multiple characters.
(BOM is also contained in _input_.)

So..., how I get a UTF-8 file properly mapped into an dynamic array?



More information about the Digitalmars-d-learn mailing list