One other things you could try is get the escape sequence for UTF-8 which
represents the characters in question and use that in your script. For
example:
require 'watir-webdriver'
b = Watir::Browser.new
b.goto('http://www.sociology.emory.edu/globalization/nonenglishlinks.html#1
')
puts b.blockquotes.first.text
=> "NGO (Erkl\u00E4rung von Bern) focusing on fair economic relations and
cultural exchange between Switzerland and developing countries; has
information on trade and culture"
In this example if you wanted to verify the german text for the first
blockquote on the page you would use:
Erkl\u00E4rung
instead of:
Erklärung
where \u00E4 == ä
I'm sure there must be tools out there to help translate displayed fonts to
the unicode representation, you might want to google for such.
On Fri, Nov 9, 2012 at 7:52 AM, Cliff Cyphers <[email protected]>wrote:
> how about you post the code block in question and a site that is reachable
> by all. without doing so one can't expect troubleshooting past what's
> already been suggested. Also, you can look at setting your LANG at the OS
> level so that all ruby objects use that as default.
>
>
> On Fri, Nov 9, 2012 at 7:25 AM, Adrian Killens <[email protected]>wrote:
>
>> Hi There, I added the following lines to top of my rb file that's got the
>> non-english characters in it:
>>
>> require "encoding"
>> Encoding.default_internal='UTF-8'
>> Encoding.default_external='UTF-8'
>>
>> Still having problems though. I noticed that the encoding.rb file has
>> most of its contents commented out. Is this normal?
>> Cheers
>> Aidy
>>
>> On Friday, 9 November 2012 15:23:59 UTC, Adrian Killens wrote:
>>>
>>> That didn't work, in this instance I need to grab via the non-english
>>> tags as I'm doing some testing around translations.
>>>
>>> On Friday, 9 November 2012 14:17:19 UTC, Joe Fl wrote:
>>>>
>>>> Hi Aidy,
>>>>
>>>> Are there any other elements you can use for this link?
>>>>
>>>> Have you tried this?
>>>> browser.link(:id,/Tovabb/).**click
>>>>
>>>> Regards,
>>>> Joe
>>>>
>>>> On Fri, Nov 9, 2012 at 7:49 AM, Adrian Killens <[email protected]>
>>>> wrote:
>>>> > Hi There,
>>>> > Does anyone know how I can click things in non-english languages that
>>>> have
>>>> > non-english characters identifying them?
>>>> >
>>>> > E.g.
>>>> > browser.link(:id, 'Tovább').click
>>>> >
>>>> > I get the following trying to click these links:
>>>> >
>>>> > invalid multibyte char (US-ASCII) (SyntaxError)
>>>> > invalid multibyte char (US-ASCII)
>>>> >
>>>> > Cheers
>>>> > Aidy
>>>> >
>>>> > --
>>>> > 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<http://groups.google.com/group/watir-general>
>>>> > watir-genera...@googlegroups.**com
>>>>
>>> --
>> 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]
>>
>
>
--
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]