[Mono-list] UTF support
Miguel de Icaza
miguel at novell.com
Wed Jun 27 10:29:40 EDT 2007
I added this to the FAQ:
==== How does Unicode interact with Mono? ====
These are a few bits that you might want to know when dealing with
Unicode strings in Mono and Unix:
* Mono compilers will default to the current language encoding as their
native encoding. If your LANG environment variable contains the
terminator UTF-8 (for example mine is LANG=en_US.UTF-8) it will process
its input files as UTF-8
* You can control the encoding used by the compilers using the
-codepage: command line option, for the special case of utf-8, you can
use: -codepage:utf8 to inform the compiler that your sources are in
UTF-8, for more codepages, see the manual page for the compiler.
* CIL executables generated by the Mono compilers store everything in
* If you are dealing with ASP.NET that invokes the compiler
automatically for you, you can control the encoding used by specifying
this on the web config file. See the reference for
[[Config_system.web_globalization|web/globalization] for details.
The above takes care of converting the input you provide to Mono
compilers and runtimes into Unicode. Another issue is how these
characters get rendered into the screen.
For console output Mono will use the encoding specified in your LANG
environment variable to display the Unicode strings that the program
has. If your LANG variable does not allow for the full range of
Unicode strings to be displayed (for example, LANG=en alone) then only
the subset supported by that specific character set can be displayed.
More information about the Mono-list