Firewatir and Accents

Dear all,

I’d like to use firewatir to automate a website (ruby 1.9.1p243
on ubuntu jaunty, Firefox 3.0.14, latest firewatir).
The script below is supposed to conjugate some Portuguese verbs.
The code below works nicely as long as there are
no accents in the infinitives of the verbs,
so “fazer” is ok.
But there just seems to be no way to make this
script conjugate a verb with an accent in it, like
“abraçar” (with a c-cedilla).

I tried various combinations of iconv, cgi.escape,…
What’s the best way to do this ?

Thank you very much!

Best regards,


require ‘rubygems’
require “firewatir”
require “iconv”
require “cgi”

$test_site = “Conjugador de Verbos da Língua Portuguesa
$browser =

class PortugueseVerb
attr_accessor :pattern,:tempos,:formas
def initialize(infinitive)
ic_ignore =‘iso-8859-1’, ‘UTF-8’)
$browser.goto $test_site
$browser.text_field(:name, “verbo”).set verbo
$browser.button(:type, “submit”).click“port_verbs/verbo_#{infinitive}.txt”,“w”)
f.puts ic_ignore.iconv($browser.text)

ic_ignore2 =‘iso-8859-1’, ‘UTF-8’)

puts verbo=ic_ignore2.iconv(verb)