Hi, I used r18n-desktop (http://r18n.rubyforge.org/) for localization, it worked well. But I have trouble displaying Chinese characters in StyledTextCtrl, On Mac, the control accepts characters, but failed to save (could be problems in my application, the file becomes empty) on Windows, typed or copied chinese characters showed as blocks, failed to save as well. I did a search ''Unicode'' in this forum, couldn''t find relevant posts. Thanks, Zhimin -- Posted via http://www.ruby-forum.com/.
Zhimin Zhan
2009-Apr-16 04:47 UTC
[wxruby-users] Displaying Asian characters in StyledTextCtrl
Thanks Mario> http://wxruby.rubyforge.org/doc/styledtextctrl.html#text_encodingI did notice this as well, few meaningful examples found on Internet. def initialize super() self.set_code_page(STC_CP_UTF8) end The problem (not being able to save the file) remains. Regards, Zhimin -- Posted via http://www.ruby-forum.com/.
Zhimin Zhan
2009-Apr-16 05:54 UTC
[wxruby-users] Displaying Asian characters in StyledTextCtrl
> How exactly are you saving the file?class EditorSession < Wx::StyledTextCtrl def initialize super # ... self.set_code_page(STC_CP_UTF8) # ... end def save_file(name) puts "calling save file #{name} " begin super puts "saved Ok" # ... rescue => e puts "error: saving file: #{e}" logger.warn "failed to save #{name}: #{e}" end end Output: calling save file F:/samples/chinese_spec.rb saved Ok Then the file content is cleared. Zhimin -- Posted via http://www.ruby-forum.com/.