Best way to read/write Chinese (GBK/GB18030) files?

ryuukk_ ryuukk.dev at gmail.com
Tue Mar 7 02:59:35 UTC 2023


On Tuesday, 7 March 2023 at 01:45:27 UTC, John Xu wrote:
> I'm new to dlang. I didn't find much tutorials on internet 
> about how to read/write Chinese easily. std.encoding doesn't 
> seem to support GBK or GB18030:
>
> "Encodings currently supported are UTF-8, UTF-16, UTF-32, 
> ASCII, ISO-8859-1 (also known as LATIN-1), ISO-8859-2 
> (LATIN-2), WINDOWS-1250, WINDOWS-1251 and WINDOWS-1252."
>
> Then what is best way to read GBK/GB18030 contents ? Even 
> GBK/GB18030 file names ?

I found this: 
https://github.com/meatatt/exCode/blob/master/source/excode/package.d

There is mention of unicode/GBK conversion, maybe it could be 
helpful


More information about the Digitalmars-d-learn mailing list