You may need to encode. Something like:

puts @agent.element(:id,'blah').encode('UTF-8').to_s

NOTE: Some characters may not encode to UTF-8 however the euro is.

If the comparisons are in your script then that script file needs to be 
saved in UTF-8 format.



On Tuesday, September 23, 2014 11:35:16 PM UTC-5, Greg Allen wrote:
>
> I am trying to load a web page using Watir:
>
>         @agent = Watir::Browser.new(:firefox)
>         @agent.goto url
>
> The web page I am going to contains the euro symbol in strings like this: 
> € 1.038,00
>
> If I pull up the page in FireFox and do a view source, I can see the text 
> fine.
>
> However, when I print out the HTML in ruby, or access the text of an 
> element, I get this: € 1.038,00
>
> I have confirmed that the encoding for the browser and for the strings 
> appears to be UTF-8.
>
> I am even running my test on windows and can see FireFox starting up and 
> going to the page, which displays the euro symbol correctly.  But again, 
> when I try to access any of these fields in ruby the euro symbol seems to 
> be wrong.
>
> Can somebody tell me what is going on?
>
> Thanks,
>
> -- Greg
>
>
>
>

-- 
-- 
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]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to