Thanks Felipe that is working so far. I am going to include my class
so that it helps others
require 'win32ole'
require 'iconv'
$KCODE='u'
WIN32OLE.codepage = WIN32OLE::CP_ACP #UTF8
class International
def initialize
# get log handle (should already exist; create returns)
@log = TestLog.create("c:/","does not exist")
end
def convert(from, to, input)
Iconv.conv(from,to, input)
end
def convCP1252toUTF8(input)
convert('CP1252', 'UTF-8', input)
end
def convCP1252toUTF8Array(input)
output = []
input.each do |x|
output.push(convCP1252toUTF8(x))
end
return output
end
end
If there are questions please ask
On Jun 30, 2:55 pm, Felipe Knorr Kuhn <[email protected]> wrote:
> Hello,
>
> I am using the following, found somewhere on the net (or even this list :)
>
> $KCODE = "u"
> WIN32OLE.codepage = WIN32OLE::CP_UTF8
>
> require 'iconv'
>
> module FireWatir
> class DD < NonControlElement
> TAG='DD'
> end
> class DL < NonControlElement
> TAG='DL'
> end
> class DT < NonControlElement
> TAG='DT'
> end
> class STRONG < NonControlElement
> TAG='STRONG'
> end
> class TextField
> def doKeyPress( value )
> # do not ask me why
> value = Iconv.conv('CP1252', 'UTF-8', value)
> @o.value = value
> fire_key_events
> end
> end
> end
>
> See if that helps
>
> FK
>
> 2009/6/30 Loft_Tester <[email protected]>
>
>
>
>
>
> > I saw a post asking for the same thing a year ago and it didn't get
> > any responses so I would like to try asking again and maybe one of you
> > out there could help.
>
> > I am trying to read internationalized data in a text field.
> > Field contents = Paço
> > firewatir returns = Paço
>
> > This all works fine in IE here's what I have tried from searching in
> > this forum
> > setting
> > $KCODE='u'
>
> > I have also tried
>
> > require 'win32ole'
> > WIN32OLE.codepage = WIN32OLE::CP_ACP #UTF8
>
> > and have returned the same data
> > to see that data in a field you can go to
>
> >http://www.google.com/search?rlz=1C1GGLS_enUS311US311&aq=f&sourceid=c...o<http://www.google.com/search?rlz=1C1GGLS_enUS311US311&aq=f&sourceid=c...>
>
> > thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---