Unicode -> Windows 1252

Tom tom at nospam.com
Wed Mar 16 17:26:14 PDT 2011


El 16/03/2011 21:21, Andrej Mitrovic escribió:
> On 3/17/11, Tom<tom at nospam.com>  wrote:
>> El 16/03/2011 20:36, Tom escribió:
>>> El 16/03/2011 19:27, Andrej Mitrovic escribió:
>>>> import std.c.windows.windows;
>>>> extern(Windows) BOOL SetConsoleOutputCP(UINT);
>>>> SetConsoleOutputCP(65001);
>>>
>>> Tried a bunch of values and all yields the same result.
>>>
>>> Thanks anyway.
>>
>>
>> Forget it, I'll just use chcp...
>>
>
> You probably already know this, but you can do that programmatically:
>
> import std.process;
> void main()
> {
>      system("chcp 1252");
> }

Yeah. And by the way, SetConsoleOutputCP(65001) worked!

Don't know what I did the first time I tried it.

Another question: is there a way to hook a function or delegate before 
every output of the program, so I can filter the output in some way?

Tom;


More information about the Digitalmars-d-learn mailing list