[Mono-dev] [PATCH] Use correct console code page on Windows (affects Linux as well)

Kornél Pál kornelpal at gmail.com
Thu Jul 27 11:53:37 EDT 2006


Hi,

I recently posted this patch:
http://lists.ximian.com/pipermail/mono-devel-list/2006-July/019433.html

But I received no comments and didn't think that this can cause problems on 
other OSes so I commited it:
http://lists.ximian.com/pipermail/mono-patches/2006-July/077941.html

This was later reverted by Miguel because he pointed out that this causes 
problems on non-Windows operating systems:

>    There is already a process to fetch the proper encoding in the file,
>and you added a new setup.   And to make things worse, considering the
>inliner can decide to inline, this means that on Linux, we get an extra
>hit for looking up kernel32.dll every time.
>
>    If this is required, discuss this on the list.
>
>open("/mono/lib/mono/1.0/advapi32.dll", O_RDONLY|O_LARGEFILE) = -1
>ENOENT (No such file or directory)
>open("/mono/lib/mono/1.0/kernel32.dll", O_RDONLY|O_LARGEFILE) = -1
>ENOENT (No such file or directory)
>open("/mono/lib/mono/1.0/ole32.dll", O_RDONLY|O_LARGEFILE) = -1 ENOENT
>(No such file or directory)

As for advapi32.dll and ole32.dll I don't think that these hints are caused 
by my modifications.

Windows uses different code pages (DOS code pages) for console than for GUI 
applications (that is Encoding.Default) so this patch (or something 
functionally equivalent) is required.

This initialization is done only once (in static constructor) so I don't 
think that it's worth to use ConsoleDriver in NET_1_1 as well.

Please help to solve this problem occurring on Linux.

Kornél 




More information about the Mono-devel-list mailing list