From: Hidetoshi NAGAI Date: 2004-02-15T22:22:44+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'm pretty new to Ruby and was wondering if it is possible to read lines > from a UTF-8 encoded file (some Japanese text in this case) and write > them to a text area in a TK gui. Did you try "Tk.encoding = 'utf-8'"? For example, -------------------------------------------------------------------- require 'tk' Tk.encoding = 'utf-8' txt = TkText.new.pack IO.foreach('a_UTF-8_encoded_file') {|line| txt.insert('end', line)} Tk.mainloop -------------------------------------------------------------------- -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)