Can't display multi byte string on MonoDevelop Mac OS X

别等时光非礼了梦想. 提交于 2019-12-11 06:00:01

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/2775061/cant-display-multi-byte-string-on-monodevelop-mac-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!