开发者

Motif programming and UTF-8

开发者 https://www.devze.com 2023-04-07 17:12 出处:网络
I\'m new to Motif programming and I want to use UTF-8 encoding. I\'ve tried XtSetLanguageProc (NULL, NULL, NULL); but when I rea开发者_如何学God a file in Motif (editor text-like in 6A volume motif p

I'm new to Motif programming and I want to use UTF-8 encoding.

I've tried XtSetLanguageProc (NULL, NULL, NULL); but when I rea开发者_如何学God a file in Motif (editor text-like in 6A volume motif programming), I've got problems with accented characters.

I had to use setlocale()?

thanks!


With Motif, you have to switch to the correct font for the languages that you are using. There is currently no single UTF-8 font that has full support for all languages.

If there is more to your problem you might want to ask it on MotifZone http://www.motifzone.com/forum/unicode-support since Motif is not a commonly used toolkit anymore.


As Michael said, you need a font that supports Unicode. The ones with most broad support are Iso10646 fonts. Assuming Linux with X11, launch xfontsel to find them. Select iso10646 from the rgstry drop-down menu. Then fmly menu will list available fonts with that encoding. Some are very limited, but

-*-fixed-medium-*-*-*-18-*-*-*-*-*-iso10646-*

is a good choice that comes with the X11 installation.

Then, you need either to set that font as a fallback in your Motif program or supply the resource via command-line

xmprogram -xrm '*fontList: -*-fixed-medium-*-*-*-18-*-*-*-*-*-iso10646-*'

If all worked right, there will be no problems with accented characters anymore.

For a font supporting even more glyphs, consider GNU Unifont.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号