1. Use Ruby 1.8.3. The version of WIN32OLE included here has new support for alternate
codesets.
2. Add the following line to the top of the script:
WIN32OLE.codepage = WIN32OLE::CP_UTF8
I believe that Dave's advice regards what you need in order to embed Asian characters in Ruby Scripts themselves. I didn't do this myself. Instead, i used data-driven testing and read and wrote the data to excel spreadsheets. I found that Excel had better support for Asian characters than the code editors i use for Ruby.
Bret
On 2/21/06, Dave Burt <[EMAIL PROTECTED]
> wrote:
Hi,
Has $KCODE been mentioned yet on this list?
> I need to test some of our webproducts and websites in foreign
> languages and I'm having problems with testing using Asian
> characters (European characters seem ok)... I set the script to look
> for specific text like "?x?? ?????????? ???^?m??" --> (this is
> traditional Chinese for 'select "page forward" to continue') -- but it fails
> when run... Is there some sort of character setting I need to adjust in
> Watir? I have not tried the various possibilities but would it work
> better to change the search text to some encoding like Hexadecimal
> (\u9078\u53D6 \u300C\u4E0B\u4E00\u6B65\u300D
> \u4EE5\u7E7C\u7E8C\u3002) work better?
You need to tell Ruby the character set you're using in your script
using the KCODE directive. For example, put the following line at the
top of your script for UTF-8:
$KCODE = 'UTF-8'
Other recognised values are "EUC" and "Shift-JIS".
You'll still probably run into some issues with regexps and so on, but
that should get Ruby to understand your script.
I hope this helps.
Cheers,
Dave
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
