views:

155

answers:

4

The problem is following one line code:

Console.WriteLine ("あ");

This results in the following output in Application Output window:

?

How can I display "あ" instead of "?" in Application Output window.

I made sure following things:

  • The source code encoding is UTF-8
  • I selected Japanese font set "Osaka Regular-Mono" (Preferences > General > Font)
  • Executing the exe from a terminal, "あ" is displayed correctly on terminal window
  • On Ubuntu's MonoDevelop, "あ" is displayed correctly in Application Output window

Environments:

  • MonoDevelop 2.2.2
  • Mono 2.6.4
  • Mac OS X 10.6.3
A: 

Thanks Niels P.

Unicode codepoint of 'あ' is U+3042. I tried following code:

char ch = '\u3042';
Console.WriteLine(ch);

This result in the same problem displaying '?' in Application Output window.

I tried the same code in Ubuntu MonoDevelop, and got a correct result displaying 'あ'.

wataradio
A: 

The problem is the Mac version of the Pango library that MonoDevelop uses for font rendering doesn't currently support font fallbacks for missing glyphs. Usually, if the Japanese characters are not available in a font, the renderer should fall back to the glyph from the default Japanese font.

MonoDevelop 2.4 Beta 1 supports setting a custom font for the output pads, so as a workaround you can set Okasa as the font for the output pads.

mhutch
A: 

Thanks, mhutch.

I tried MonoDevelop 2.4 Beta 1 setting following options:

  • Preferences > Visual Style > User Interface Language > Japanese
  • Preferences > Visual Style > Custom font for pads > Osaka Regular-Mono
  • Preferences > Visual Style > Custom font for Output pads > Osaka Regular-Mono

The result remained displaying '?' in Application Output window.

All user interface are displayed in the Japanese font except Application Output content.

wataradio
A: 

Monodevelop has problems with saving unicode. I have Monodevelop clone 2.4 for Unity 3d. My problems are also "??". If you create new file "Add file" it creates file with something like unicode encoding, but characters from czech alphapet are missing.

If I resave file with "Save As" and pick UTF16 everything is ok. Problem is that czech characters are included in base UTF8. :( #fail

working on Mac

Michal