Yay!!
I have a found a way to make this work. Instead of using the text_field's
set method directly setting the value to the text_field is working without
any issues. Please find the working code which was able to enter japanese
characters in a textbox. I saved the ruby script using the notepad++ editor
in the UTF-8 without BOM encoding. Hope this helps other Watir users stuck
like me.
require 'paths.rb'
require 'win32ole'
require 'watir'
WIN32OLE.codepage = WIN32OLE::CP_UTF8 #UTF-8
###############################################
$Browser = nil
ENV["watir_browser"]="ie"
$Browser = Watir::IE.start("www.google.com")
$Browser.text_field(:name,'q').value = "管理者"
#######################################################
On Monday, November 26, 2012 11:45:19 AM UTC+5:30, Ashok Prabhu wrote:
>
> Hi Zeljko,
>
> I tried to read the japanese characters from an excel sheet. However it
> does not seem to work. It showing up boxed characters still in internet
> explorer text_field.
>
> Thanks,
> ~Ashok.
>
> On Friday, November 23, 2012 9:27:04 PM UTC+5:30, Željko Filipin wrote:
>>
>> On Fri, Nov 23, 2012 at 4:18 PM, Ashok Prabhu <[email protected]>
>> wrote:
>> > m using ruby 1.8.6 and watir 1.5.1.1230 for my testing. I m trying to
>> > enter some japanese characters into the internet explorer textbox
>> > using watir. However I getting a series of boxed characters instead.
>>
>> Maybe one of these old posts could help you since you are using pretty
>> old versions of both Ruby and Watir:
>>
>> http://zeljkofilipin.com/enter-non-english-character-in-text-field/
>> http://zeljkofilipin.com/utf-8-and-ruby/
>>
>> Željko
>>
>
--
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]