Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/23/19 2:52 PM, Symphony wrote: Pardon my ignorance, but wouldn't the inclusion of a std.io (e.g. Martin Nowak's io library) into Phobos be an easier and cleaner move? Other Phobos modules that require std.stdio could be gradually changed so that they use std.io instead. Well, that's

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread Symphony via Digitalmars-d-learn
On Monday, 23 December 2019 at 15:34:13 UTC, Steven Schveighoffer wrote: I really appreciate the enthusiasm here, but at the risk of being cynical, I see little chance that this gets accepted. Before you spend any time on actual code, a DIP is going to be required, as this would be a huge

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/23/19 11:02 AM, Adam D. Ruppe wrote: On Monday, 23 December 2019 at 15:41:33 UTC, Steven Schveighoffer wrote: That means we have to buffer separately, which means we have a problem interleaving printf with writef. It would be awful. Or simply don't buffer. Any call you get, flush the C

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Dec 23, 2019 at 10:41:33AM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] > There's this guy, his name is Walter. He likes printf. I'm pretty sure > when he's buried, his cold dead fingers will be tightly and > inextricably wrapped around printf. [...] But that's not a

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 23 December 2019 at 15:41:33 UTC, Steven Schveighoffer wrote: That means we have to buffer separately, which means we have a problem interleaving printf with writef. It would be awful. Or simply don't buffer. Any call you get, flush the C buffer and write the D stuff immediately.

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/23/19 10:48 AM, bachmeier wrote: On Monday, 23 December 2019 at 15:34:13 UTC, Steven Schveighoffer wrote: I really appreciate the enthusiasm here, but at the risk of being cynical, I see little chance that this gets accepted. Before you spend any time on actual code, a DIP is going to

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread bachmeier via Digitalmars-d-learn
On Monday, 23 December 2019 at 15:34:13 UTC, Steven Schveighoffer wrote: I really appreciate the enthusiasm here, but at the risk of being cynical, I see little chance that this gets accepted. Before you spend any time on actual code, a DIP is going to be required, as this would be a huge

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/23/19 10:25 AM, H. S. Teoh wrote: On Sun, Dec 22, 2019 at 10:04:20PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: [...] Regardless, I'm pretty well of the opinion that fwrite is the wrong thing to do anyway. fwrite writes bytes to a file, but we want to write strings to the

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/22/19 11:53 PM, Symphony wrote: On Sunday, 22 December 2019 at 22:47:43 UTC, Steven Schveighoffer wrote: To fix Phobos, we just(!) need to remove libc as the underlying stream implementation. I had at one point agreement from Walter to make a "backwards-compatible-ish" mechanism for

Re: unicode characters are not printed correctly on the windows command line?

2019-12-23 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Dec 22, 2019 at 10:04:20PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: [...] > Regardless, I'm pretty well of the opinion that fwrite is the wrong > thing to do anyway. fwrite writes bytes to a file, but we want to > write strings to the console. There's other functions that do

Re: unicode characters are not printed correctly on the windows command line?

2019-12-22 Thread Symphony via Digitalmars-d-learn
On Sunday, 22 December 2019 at 22:47:43 UTC, Steven Schveighoffer wrote: To fix Phobos, we just(!) need to remove libc as the underlying stream implementation. I had at one point agreement from Walter to make a "backwards-compatible-ish" mechanism for file/streams. But it's not pretty, and

Re: unicode characters are not printed correctly on the windows command line?

2019-12-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/22/19 5:04 PM, Adam D. Ruppe wrote: On Sunday, 22 December 2019 at 18:41:16 UTC, Steven Schveighoffer wrote: Phobos doesn't call the wrong function, libc does. Phobos uses fwrite for output. There is allegedly a way to set fwrite to do the translations on MSVCRT:

Re: unicode characters are not printed correctly on the windows command line?

2019-12-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 22 December 2019 at 18:41:16 UTC, Steven Schveighoffer wrote: Phobos doesn't call the wrong function, libc does. Phobos uses fwrite for output. There is allegedly a way to set fwrite to do the translations on MSVCRT:

Re: unicode characters are not printed correctly on the windows command line?

2019-12-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/22/19 8:40 AM, Adam D. Ruppe wrote: On Sunday, 22 December 2019 at 06:25:42 UTC, rikki cattermole wrote: Not a bug. No, Phobos is *clearly* in the wrong here. There is a proper fix. Phobos doesn't call the wrong function, libc does. Phobos uses fwrite for output.

Re: unicode characters are not printed correctly on the windows command line?

2019-12-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 22 December 2019 at 06:25:42 UTC, rikki cattermole wrote: Not a bug. No, Phobos is *clearly* in the wrong here. There is a proper fix. http://dpldocs.info/this-week-in-d/Blog.Posted_2019_11_25.html#unicode Use the correct WriteConsoleW api instead of the ancient ascii api.

Re: unicode characters are not printed correctly on the windows command line?

2019-12-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 22 December 2019 at 06:11:13 UTC, moth wrote: is there any function i can call or setting i can adjust to get D to do the same, or do i have to wait for something to be fixed in the language / compiler itself? It isn't the language/compiler per se, it is the library calling the

Re: unicode characters are not printed correctly on the windows command line?

2019-12-22 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 22 December 2019 at 06:25:42 UTC, rikki cattermole wrote: On 22/12/2019 7:11 PM, moth wrote: is there any function i can call or setting i can adjust to get D to do the same, or do i have to wait for something to be fixed in the language / compiler itself? Not a bug. This

Re: unicode characters are not printed correctly on the windows command line?

2019-12-21 Thread rikki cattermole via Digitalmars-d-learn
On 22/12/2019 7:11 PM, moth wrote: hi all. been learning d for the last few years but suddenly realised... when i use this code: writeln('♥'); the output displayed on the windows command line is "ÔÖÑ" [it works fine when piped directly into a text file, however]. i've looked about in this