Unicode (on Win9x)
-
Hey all! I noticed that IE can display text in foreign languages on buttons, in list boxes and as HTML (rich text), even on Win9X platforms (with no special foreign-language installations). I would like to incorporate similar functionality in my application. I managed to write SOME Unicode text on the Rich Edit control (Hebrew, Arabic, no Chinese though). I didn't manage to display foreign languages in the List View common control (tried using the CCM_SETUNICODEFORMAT message, didn't help), and I have no idea how to write such text on a simple button. Any ideas? Thanks!
-
Hey all! I noticed that IE can display text in foreign languages on buttons, in list boxes and as HTML (rich text), even on Win9X platforms (with no special foreign-language installations). I would like to incorporate similar functionality in my application. I managed to write SOME Unicode text on the Rich Edit control (Hebrew, Arabic, no Chinese though). I didn't manage to display foreign languages in the List View common control (tried using the CCM_SETUNICODEFORMAT message, didn't help), and I have no idea how to write such text on a simple button. Any ideas? Thanks!
hi, make your button ownerdraw and use
TextOutW()
to draw the text... have fun... jk :cool: -
hi, make your button ownerdraw and use
TextOutW()
to draw the text... have fun... jk :cool:Hey, thanks! I'll try that, I think it would help. I have three more questions though. I guess I would have to change the font before writing the string. My application doesn't know in advance what language will be displayed. How do I dynamically find out which font to load? Isn't there some font that encodes ALL languages? Secondly, suppose I have a Unicode string that is encoded in a single language. How do I find out which language it is encoded with? (Do I have to compare the characters to the Unicode table of languages, or is there a simpler way to do that?) Last question - do I also have to take care of font selection when I work with the Rich Edit control, or can it select the proper font automatically? Thank you very much!! Oz
-
Hey, thanks! I'll try that, I think it would help. I have three more questions though. I guess I would have to change the font before writing the string. My application doesn't know in advance what language will be displayed. How do I dynamically find out which font to load? Isn't there some font that encodes ALL languages? Secondly, suppose I have a Unicode string that is encoded in a single language. How do I find out which language it is encoded with? (Do I have to compare the characters to the Unicode table of languages, or is there a simpler way to do that?) Last question - do I also have to take care of font selection when I work with the Rich Edit control, or can it select the proper font automatically? Thank you very much!! Oz
Hi Oz, 1) you should select the appropriate font for the respective language. "Arial" covers the most eastern and western languages including cyrillic, greek, and turkish. For asian languages you have to use different fonts: japanese - "MS Gothic", chinese - "MS Hei", korean - "GulimChe"... As far as I know, there's no font that covers all unicode languages at once. 2) I guess you have no chance to retrieve a specific language from a unicode string by comparing the character values. There are too many characters which are used in more than one language. Just think about an 'e' ... 3) I haven't much experience with the rich edit control, sorry. But I remember that one must at least set the right font codepage for a proper display... have fun... jk :cool: