March 13, 2023
On 3/12/23 8:32 PM, zjh wrote:
> On Sunday, 12 March 2023 at 20:03:23 UTC, 0xEAB wrote:
>> ...
> 
> Thank you for your reply, but is there any way to output `gbk` code to the console?
> 

What is required is an addition to the `std.encoding` module, to allow such an encoding.

Encodings are simply translating some encoding (e.g. utf) to another (e.g. gbk). If you look at `std.encoding` you can get an idea of what it might require.

It will take some effort and especially some help from a knowledgeable user (such as yourself).

-Steve
March 14, 2023

On Monday, 13 March 2023 at 15:50:37 UTC, Steven Schveighoffer wrote:

>

What is required is an addition to the std.encoding module, to allow such an encoding.

Thank you for your information.

March 14, 2023

On Monday, 13 March 2023 at 00:32:07 UTC, zjh wrote:

>

Thank you for your reply, but is there any way to output gbk code to the console?

I guess if your console is in gbk encoding, you can just write bytes with stdout.write.

March 14, 2023

On Tuesday, 14 March 2023 at 09:20:54 UTC, Kagamin wrote:

>

I guess if your console is in gbk encoding, you can just write bytes with stdout.write.

Thank you for your reply, but only display bytes, not gbk text.

March 22, 2023

https://dlang.org/phobos/std_stdio.html#rawWrite

March 23, 2023

On Wednesday, 22 March 2023 at 15:23:42 UTC, Kagamin wrote:

>

https://dlang.org/phobos/std_stdio.html#rawWrite

It's really amazing, it succeeded. Thank you!

    auto b="test.txt";//gbk
    void[]d=read(b);
    stdout.rawWrite(d);
1 2
Next ›   Last »