From: Jian Lin Date: 2009-05-13T18:51:06+09:00 Subject: Re: converting UTF-8 to entities like 剛 Wisccal Wisccal wrote: > If you are one 1.9, you could use String.codepoints. Something similar > to: > >>> '威斯加的中文很不好'.codepoints.to_a.map {|e| "&#x#{e.to_s(16)};"} > => ["威", "斯", "加", "的", "中", > "文", "很", "不", "好"] > > HTH > 威斯加 that's really cool... Wisccal, how do you know Chinese? -- Posted via http://www.ruby-forum.com/.