From: Ryan Smith Date: 2010-02-08T09:51:02+09:00 Subject: Re: same character show different code in two machine Are the two machines getting the text from the same source? yes, from a same public web page. like http://www.abc.com/xyz.htm What is the source? as above, source is webpage, using Watir to parse the webpage. What is the encoding of the source? text/html; charset=utf-8 What locale is Ruby running under? you mean Windows system locale? Machine A is "Win XP Pro (English version)", system locale is "PRC" Machine B is "Win XP Pro (Chinese version)", system locale is "中文(中国)" So in my point, A and B has indentical system locale. What version of Ruby are you running? Machine A and B both are ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] What encoding is the relevant Ruby source file set to? A and B using same set of ruby script, their are in utf-8 encoding. both has this line in the head of script. # -*- coding: utf-8 -*- How are you retrieving the text from the source? Using Watir to parse text in the webpage. What encoding is the string once its finally retrieved? I have no idea with this, How to get this? -- Posted via http://www.ruby-forum.com/.