From: Hidetoshi NAGAI Date: 2004-02-14T11:17:53+09:00 Subject: Re: reading UTF-8 lines and writing to TK text area Hi, From: Matthew Huggett Subject: reading UTF-8 lines and writing to TK text area Date: Fri, 13 Feb 2004 19:52:31 +0900 Message-ID: <402CAC30.1030804@zam.att.ne.jp> > I was able to do this in Python with > unicode strings (e.g., u'\u-someCharCode') but with my Ruby script the > text is garbled. A sample script 'unicodeout.rb' may help you. You'll be able to find it at ext/tk/sample/demos-en/ on the Ruby source archive. For exapmle, ---------------------------------------------------------- require 'tk' t = TkText.new.pack txt = Tk::UTF8_String('\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ' + '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA') t.insert('end', txt) Tk.mainloop ---------------------------------------------------------- -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)