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/.