[Mono-dev] [PATCH] Use Unicode argv on Windows

Kornél Pál kornelpal at gmail.com
Mon Mar 31 17:55:07 EDT 2008


Hi,

Currently mono.exe uses ANSI arguments that are encoded using system default 
code page (ACP). Mono however uses UTF-8 and tries to convert them using 
MONO_EXTERNAL_ENCODINGS.

This patch takes the Unicode (UTF-16) command line arguments and converts 
them to UTF-8. This way there is no need to modify other code to use UTF-16 
and the arguments still are in Unicode.

I also made strenc.c non-Windows in this patch because 
MONO_EXTERNAL_ENCODINGS should not be used on Windows at all as it uses 
UTF-16 internally and if we really need UTF-8 then we should convert from 
UTF-16 rather than from ACP.

I would prefer to move argument conversion using mono_utf8_from_external to 
main.c as well that would make code more clean but that would require 
mono_runtime_run_main being called with UTF-8 arguments. If that is 
acceptable I'll include that modification in the patch as well.

Kornél 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: WindowsUnicodeArgv.diff.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080331/7bee4709/attachment.txt 


More information about the Mono-devel-list mailing list