[Mono-list] UTF support

Adrien Dessemond adrien.dessemond at softhome.net
Wed Jun 27 08:03:51 EDT 2007


On Wed, 2007-27-06 at 10:42 +0200, Andreas Färber wrote:
> Am 27.06.2007 um 01:33 schrieb Jacob Rhoden:
> 
> > Given a very simple hello world excercise, but with chinese  
> > characters,
> > the characters turn out as question marks. My  
> > NotifyIcon.ShowBalloonHelp
> > function in my windows app, also results in question marks? I cant  
> > find
> > any help on the website about utf, nor is there much in the man page.
> > Any pointers?
> 
> The compilers all have a -codepage: parameter to specify the encoding  
> of the input files.

I do not know if the following link could also help :

http://www.yoda.arachsys.com/csharp/strings.html#culture

The more I read, the more I feel lost about encodings in Console/.Net...
When I compile Jacob's code (I used Gnome terminal), I have this :

IL_0000:  ldstr bytearray (
        48 00 65 00 6c 00 6c 00 6f 00 20 00 57 00 6f 00  
        72 00 6c 00 64 00 21 00 20 00 f3 97 50 4e 00

Wasn't the string supposed to be encoded as UTF-16 (or at is, is it
encoded in UTF-16 when the assembly is loaded in memory) ? I see only
one nul byte at the end...

If the string is wrote back on a terminal, I suppose (by having a quick
look at the mono source code) it is transposed in UTF-8 next written in
stdout ? Another part of my question is about console fonts
management/unicode in a tty, documentation around is very scattered and
fuzzy I can't figure out how things works precisely... (I was talked
about ACM, SFM, 4 internals mappings handled by the kernel, 256/512
chars fonts...). Can someone help me in putting the right brick of
knowledge at the right place ?

Kind regards,

Adrien




More information about the Mono-list mailing list