From: "Iñaki Baz Castillo" Date: 2009-09-02T23:59:50+09:00 Subject: Re: Ruby1.9: Encoding problems (how to use #force_encoding ?) 2009/9/2 Axel Etzold : > Dear Iñaki, > > maybe you can use CGI.escape for your encoding problems? > > I fetched the Spanish wikipedia page for Alarcón like so: > > # encoding: utf-8 > > require "cgi" > require 'open-uri' > > search_what=CGI.escape("Alarcón") > page="http://es.wikipedia.org/w/index.php?title=Especial%3ABuscar&search=#{search_what}&fulltext=Buscar" > open(page){ |f| print f.read } Thanks but the problem is that the geo_location Ruby gem returns a wrong string (encoded in ASCII-8BIT) since it contains invalid chars for ASCII-8BIT encoding, so Ruby fails when trying to convert it to other encoding :( -- Iñaki Baz Castillo