Jian Lin wrote: > > I was trying to convert UTF-8 content into a series of entities like > 剛 so that whatever the page encoding is, the characters would > show... > 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 °Ò»Û²Ã -- Posted via http://www.ruby-forum.com/.