Improving D's support of code-pages

Walter Bright newshound1 at digitalmars.com
Sat Aug 18 17:00:18 PDT 2007


Kirk McDonald wrote:
> Walter Bright wrote:
>> There's a big problem with this - what if the output is being sent to 
>> a file?
> 
> Files have no inherent encoding, only the console does. In this way, 
> writing to a file is different than writing to the console. The user 
> must explcitly provide an encoding when writing to a file; or, if they 
> are writing a char[], wchar[], or dchar[], the encoding will be UTF-8, 
> -16, or -32. (Writing a char[] implies an encoding, while writing a 
> ubyte[] does not.)


The problem is that whatever is sent to a file should be the same as 
what is sent to the screen. Consider if stdout is piped to another 
application - what should happen?



More information about the Digitalmars-d mailing list