Bret Pettichord wrote:
> visweswara wrote:
>
>> how can we make watir support utf-8 characters?, I would like to write
>> japanese characters in textboxes of webpages using watir.
>>
>> I am using watir 1.4.1 and ruby 1.8.4.20(stable) build .
>> I tried using
>>
>> WIN32OLE.codepage = WIN32OLE::CP_UTF8
>>
>> at the top of scipt , but no luck
>>
>>
> Keep trying. I seem to recall that i used code much like this over a
> year ago to read and write double-byte characters (japanese, chinese, i
> forget which) to and from IE and Excell (and thus from one to the other).
>
> I'm pretty sure i wrote up a report. Have you looked way back in the
> archives for this list?
>
Oh crap. I think i know what the problem might be.
To make this work, you have to use WIN32OLE from 1.8.4. The problem is
that Watir sneaks in a modified version of WIN32OLE from 1.8.2 that does
NOT have the WIN32OLE.codepage support.
This is all from memory, so i'm guessing. But my guess can be confirmed
by doing the following. Make sure you load win32ole BEFORE loading watir.
require 'win32ole'
require 'watir'
This will make sure that you get the official win32ole library (with the
WIN32OLE.codepage support) instead of Watir's version of WIN32OLE (which
i fear does not have this).
Why did Watir modify WIN32OLE? For our modal dialog support. (If you
need both UTF8 and modal web dialog support, you may be SOL, at least
for now.)
Could some one please try this out and report back to us as to whether
it works?
Bret
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general