[Wtr-general] Selecting an 'accented character' from a list
John Lolis
forum-watir-users at openqa.org
Fri Mar 2 11:07:01 EST 2007
Looking for a bit of help here.
I have a select list that has the following value 'Nome do serviço'.
When I do select_list(whatever).text i get back 'Nome do servi\347o'
if i look in the source of the html i get 'Nome do serviço'
I also found code to convert 'Nome do serviço' to 'Nome do serviço' (but thats not what ruby sees)
so...
I need a way to convert 'Nome do serviço' to 'Nome do servi\347o' (i think...)
# Code to convert from 'Nome do serviço' to 'Nome do serviço'
# stolen from somwhere
def entities( str )
converted = []
str.split(//).collect { |c| converted << ( c[0] > 127 ? "&##{c[0]};" : c ) }
converted.join('')
end
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6766&messageID=19489#19489
More information about the Wtr-general
mailing list