A colleague in China sent me this, I hope it helps.

Dave
---------------
Hi Dave,

In ruby, when you need to input the non-English characters, you may
need to convert the characters to the right encoding.

In my testing environment, I use the Chinese OS. Ruby 1.8.7 + Watir
1.6.5.
It seems that It’s not very well about supporting non-English in Ruby
1.8.7. But IE in the Chinese OS supports GBK (code page is 936) by
default.
So I need to make sure the code.page=65001 in SciTEGlobal.properties.
And convert the string from utf-8 to GBK.
It should use “iconv”.

require 'iconv‘
Iconv.iconv(to, from, str)
to: encoding name for destination
from: encoding name for source
Str: the string which need to be translated

Eg.
@Username=”你好”
Username_text = Iconv.conv('gbk', ‘utf-8’, @Username)


Best wishes,
Arnold


On Jan 3, 5:42 pm, Bhavesh <[email protected]> wrote:
> Hi,
>
> I have some chinese, french characters in the description filed of an
> application.
>
> I have to match that through watir/ruby scripts.
>
> But in CLI, it appears as juncked and thus pattern match failed.
>
> Do anyone know how to match I18n characters in watir?
>
> Do i need to install any addon for this to work?
>
> Any help would be highly appreciated.
>
> Thanks
> Bhavesh

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to