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!
```cpp
auto b="test.txt";//gbk
void[]d=read(b);
stdout.rawWrite(d);
```
https://dlang.org/phobos/std_stdio.html#rawWrite
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.
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.
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.
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
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?
On Sunday, 12 March 2023 at 00:54:53 UTC, zjh wrote:
On Saturday, 11 March 2023 at 19:56:09 UTC, 0xEAB wrote:
If you desire to use other encodings, how about using ubyte +
ubyte[]?
There is no example.
To read binary data from a file and dump it into another, you do:
```d
import std.file
On Saturday, 11 March 2023 at 19:56:09 UTC, 0xEAB wrote:
If you desire to use other encodings, how about using ubyte +
ubyte[]?
There is no example. An example should be added in an obvious
position.
I tried for a long time, but couldn't output `gbk`, and I finally
gave up.
On Friday, 10 March 2023 at 07:16:32 UTC, zjh wrote:
`D language` is too unfriendly for Chinese users!
You can't even write `gbk` files.
D’s char + string types are Unicode.
To quote the tour, “In D, *all* strings are Unicode strings”.
If you desire to use other encodings, how about using
On Friday, 10 March 2023 at 06:19:38 UTC, zjh wrote:
`D language` is too unfriendly for Chinese users!
You can't even write `gbk` files.
On Friday, 10 March 2023 at 02:48:43 UTC, John Xu wrote:
```d
module chinese;
import std.stdio : writeln;
import std.conv;
import std.windows.charset;
int main(string[] argv)
{
auto s1 = "中文";//utf8 字符串
writeln("word:"~ s1); //乱的
writeln("word:" ~
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
Thanks for quick answers. Now I found I can read both UTF8 and
UTF-16LE
chinese file:
string txt =
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
On 3/6/23 8:45 PM, 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),
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,
16 matches
Mail list logo