From: Axel Etzold Date: 2007-06-10T16:52:17+09:00 Subject: Re: A question about Iconv arguments Dear Alex, thank you for responding. If I try to get a webpage that has accents in its address, like > require "rubygems" > require "rio" > require 'iconv' > output_encoding = 'utf-8' > doc="Venerd�" > converted_doc = Iconv.new(output_encoding, 'latin1').iconv(doc) > rio("http://www.wikipedia.org/wiki/" + converted_doc)>rio("a.html") I get an error message: /usr/local/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?): http://www.wikipedia.org/wiki/venerd�� (URI::InvalidURIError) from /usr/local/lib/ruby/1.8/uri/common.rb:485:in `parse' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/rl/withpath.rb:285:in `uri_from_string_' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/rl/uri.rb:74:in `arg0_info_' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/rl/uri.rb:83:in `init_from_args_' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/rl/uri.rb:56:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/rl/base.rb:80:in `new' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/rl/base.rb:80:in `parse' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/rl/builder.rb:111:in `build' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/factory.rb:412:in `create_state' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio.rb:65:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio.rb:76:in `new' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio.rb:76:in `rio' from /usr/local/lib/ruby/gems/1.8/gems/rio-0.4.0/lib/rio/kernel.rb:42:in `rio' This doesn't happen if I type in: rio("http://www.wikipedia.org/wiki/Venerd%C3%AC")>rio("a.html") So I need to know what conversion arguments I need to give Iconv to turn "Venerd�" into "Venerd%C3%AC". Best regards, Axel -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f�r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer