From: Ammar Ali Date: 2010-07-12T01:02:55+09:00 Subject: Re: how to convert it into utf-8? --001636d35272ce726c048b1ec48a Content-Type: text/plain; charset=UTF-8 On Sun, Jul 11, 2010 at 1:40 PM, Pen Ttt wrote: > in my linux comsole: > ghex2 /home/pt/myday > there is the first line content > AA3F3201861F0000D61F0000 > would you mind to tell me how can convert it into utf-8? I can't tell which unicode range those specific code points belong to, but if you're sure the hex data represents utf-8, and I understand what you are asking for correctly, try something like: line.scan(/(....)/).each do |code_point| puts code_point.pack('H*') end Depending on where the data is coming from, you might need to flip the bytes to account for endianness. I don't believe that will be an issue on linux. Hope it helps, Ammar --001636d35272ce726c048b1ec48a--