[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to use Chinese Characters in wxRuby?

yang cao

3/31/2007 2:12:00 PM

I want to use Chinese characters in wxRuby,like this:
Wx::Button.new(@panel,-1,'Chinese characters wanted to be placed')
also in Chinese is:
Wx::Button.new(@panel,-1,'æ±?å­?')

but I get an empty button...

how can I do?
thanks

2 Answers

Harry

3/31/2007 3:19:00 PM

0

On 3/31/07, yang cao <caoyangruby@gmail.com> wrote:> I want to use Chinese characters in wxRuby,like this:> Wx::Button.new(@panel,-1,'Chinese characters wanted to be placed')> also in Chinese is:> Wx::Button.new(@panel,-1,'??')>> but I get an empty button...>> how can I do?> thanks>>This works for me.I cut this out of an old program I was trying.Button.new(panel, -1, "??", Point.new(10,125), Size.new(100,25))Harry-- http://www.kakueki.com/ruby/list.ht... Ruby List Subjects in English

Alex Fenton

4/2/2007 8:32:00 AM

0

yang cao wrote:
> I want to use Chinese characters in wxRuby,like this:
> Wx::Button.new(@panel,-1,'Chinese characters wanted to be placed')
> also in Chinese is:
> Wx::Button.new(@panel,-1,'æ±?å­?')

Assuming you're using wxruby2, which you should be, ensure that your script is in UTF8 encoding, and that you have $KCODE = 'u' at the top of it.

Have a look at the demo samples/text/unicode.rb which demonstrates the use of controls with labels and content in numerous different scripts including Chinese.

The wxruby-users mailing list is a good place for any questions about the toolkit:
http://rubyforge.org/mail/?g...

alex