Hi Azher,

No, that doesn't work.  Run this script:

#  encoding: utf-8

require 'watir-webdriver'

url = 
'http://www.expedia.it/Paris-Hotel-Hotel-Campanile-Paris-11-Bastille.h1150139.Informazioni-Hotel?chkin=15/02/2015&chkout=21/02/2015&rm1=a2&hwrqCacheKey=5b830eea-e007-461d-846c-c03063fe36d2HWRQ1411482385101&c=54137d03-92f1-460a-8666-8062c26aae8a&;'
agent = Watir::Browser.new(:firefox)
agent.goto url

puts agent.html

If you look at the output you can see the euro sign is not what you would 
expect.



On Wednesday, September 24, 2014 4:03:54 AM UTC-4, Azher Hussain wrote:
>
> Hi Greg,
>
> Put this ( # encoding: utf-8) on at the top of your code and it should 
> work and go to the correct web page:
>
> #  encoding: utf-8
> @agent = Watir::Browser.new(:firefox)
> @agent.goto url
>
> Regards
>
> On Wed, Sep 24, 2014 at 5:35 AM, Greg Allen <[email protected] 
> <javascript:>> 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] <javascript:>
>> http://groups.google.com/group/watir-general
>> [email protected] <javascript:>
>>
>> --- 
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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