Jump to content

[SOLVED] the problem of show chinese language in widgetlabel


photo

Recommended Posts

Posted

(use  unigine_evaluation_2013-08-16_windows.exe)

 

 

I need to show chinese language in widgetlabel ,so id change the widget font to font_ch.ttf.

and  write the script like this

 

 

lpWidgetLabel->setText("中文");  // ----in Script1.cpp file (saved as  ascii)

 

but the display  is worng .

 

 

so i did this:

1.

then i want to found something api like   asciiToUTf8  asciiToUnicode   ,but there is only  characater convert api between

utf8 and unicode .

so this way  is not ok.

 

2.

then  i save the script1.cpp to utf8 code . but when i start it  ,pop up a   load error dialog

parser:readName():bad name '口 world::loadworld():cant load "script1.cpp" world script'

 

 

what did i missed ,how to solve this problem.

should a rewrite a api like ascii to utf8 ?  or there is another way  

 

thanks!

 

Posted

well, two things you need to take care of.

 

  1. use a chinese font, and replace this font file: data/core/gui/font.ttf for gui, or/and console.ttf for conole.
  2. save your script file as UTF8, other formant won't still won't display chinese even if you have a chinese font.

 

then start playing with 中文.

 

 

or, you can you the complex way, which is edit data/core/gui/gui.rc file.

 

and all of these method requries you save your script/ui file in utf8.

Posted

i prefer use the locale to translate to chinese.

Posted

Hi Yang!

 

There should be no problems with chinese language in GUI at all. As Steve correctly noticed, your script files should be in UTF8 and you have to use chinese font in widgets in order to see chinese language.

 

If you still have problems, could you make a test sample and upload it here?

×
×
  • Create New...