This patch was provided to support input of Chinese characters.
This patch is described in more detail here.
We should either include this code in the main Watir code base or at least make it easier to extend Watir to support this kind of thing. There have been enough changes to TextField#doKeyPress since 1.4.1, that this code does not work with 1.5 as is.
I reviewed this patch and made some changes to it so that it "worked" with trunk. When i say "worked" i mean that it ran and the tests ran ok, but somehow the text was not Chinese, but latinish gibberish.
I'm not exactly sure what the problem is, but is suspect it may be my Ruby config. I tried some of the suggestions here:
One concern i have is that the recommendation there is to use WIN32OLE 1.8.3, but for other reasons Watir is tied to 1.8.2 (modal dialog support).
I'm also concerned that there are multiple Chinese encoding schemes (UTF-8, etc) and i'm not sure which one is used by this patch.
The best thing to do would probably be to formalize the "character_in" interface that Vincent Xu defined in his patch, so that future patches won't break. (I'm concerned that different languages and coding schemes may require different patches.)
Revised patch to work with trunk. See comment for status.
Ideally we add this patch to 1.5. But at minimum 1.5 needs to provide an interface (character_in) that makes it easy for users to add this kind of support.
Applied patch as supplied in commit 1305.
All the tests pass (including the new ones provided with the patch), but when they run, I don't see any Chinese. I think this is probably because my computer is not set up for Chinese input.
I would like to see someone who has a computer set up for Chinese verify this before we close this ticket.