openid/ruby-openid — Issue #25: ArgumentError  invalid byte sequence in UTF-8
Author: ananthakumaran
Created: 2011-10-14 07:43:10+00:00
State: open

It seems like REXML can only handle UTF-8. It fails for sites having other encoding(eg http://thehubhostel.com)

````ruby
begin
d = REXML::Document.new(text)
rescue RuntimeError => why
raise XRDSError.new("Not an XRDS document. Failed to parse XML.")
end
````

Full Trace

/home/ananth/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rexml/parseexception.rb:31:in `gsub'
/home/ananth/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rexml/parseexception.rb:31:in `to_s'
/home/ananth/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:95:in `message'
/home/ananth/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:95:in `rescue in parse'
/home/ananth/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:20:in `parse'
/home/ananth/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rexml/document.rb:230:in `build'
/home/ananth/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize'
/media/Studies/Git_Repo/ruby-openid/lib/openid/yadis/xrds.rb:96:in `new'
/media/Studies/Git_Repo/ruby-openid/lib/openid/yadis/xrds.rb:96:in `parseXRDS'
/media/Studies/Git_Repo/ruby-openid/lib/openid/yadis/services.rb:32:in `apply_filter'
/media/Studies/Git_Repo/ruby-openid/lib/openid/consumer/discovery.rb:202:in `from_xrds'
/media/Studies/Git_Repo/ruby-openid/lib/openid/consumer/discovery.rb:395:in `discover_yadis'
/media/Studies/Git_Repo/ruby-openid/lib/openid/consumer/discovery.rb:485:in `discover_uri'
/media/Studies/Git_Repo/ruby-openid/lib/openid/consumer/discovery.rb:494:in `discover'
oa-openid (0.3.0) lib/omniauth/openid/gapps.rb:10:in `discover'
/media/Studies/Git_Repo/ruby-openid/lib/openid/consumer.rb:333:in `discover'
/media/Studies/Git_Repo/ruby-openid/lib/openid/consumer/discovery_manager.rb:51:in `get_next_service'
/media/Studies/Git_Repo/ruby-openid/lib/openid/consumer.rb:222:in `begin'
rack-openid (1.3.1) lib/rack/openid.rb:123:in `begin_authentication'
rack-openid (1.3.1) lib/rack/openid.rb:102:in `call'
oa-openid (0.3.0) lib/omniauth/strategies/open_id.rb:70:in `start'
oa-openid (0.3.0) lib/omniauth/strategies/open_id.rb:65:in `request_phase'
oa-core (0.3.0) lib/omniauth/strategy.rb:58:in `request_call'
oa-core (0.3.0) lib/omniauth/strategy.rb:41:in `call!'
oa-core (0.3.0) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.3.0) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.3.0) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.3.0) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.3.0) lib/omniauth/strategy.rb:30:in `call'
oa-core (0.3.0) lib/omniauth/strategy.rb:44:in `call!'
oa-core (0.3.0) lib/omniauth/strategy.rb:30:in `call'
warden (1.0.5) lib/warden/manager.rb:35:in `block in call'
warden (1.0.5) lib/warden/manager.rb:34:in `catch'
warden (1.0.5) lib/warden/manager.rb:34:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.3) lib/rack/etag.rb:23:in `call'
rack (1.3.3) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.3) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.3) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/cookies.rb:326:in `call'
activerecord (3.1.0) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.0) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.0) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.3) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.0) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.3) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.3) lib/rack/lock.rb:15:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.0) lib/rails/engine.rb:455:in `call'
railties (3.1.0) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.0) lib/rails/rack/log_tailer.rb:14:in `call'
thin (1.2.11) lib/thin/connection.rb:84:in `block in pre_process'
thin (1.2.11) lib/thin/connection.rb:82:in `catch'
thin (1.2.11) lib/thin/connection.rb:82:in `pre_process'
thin (1.2.11) lib/thin/connection.rb:57:in `process'
thin (1.2.11) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.2.11) lib/thin/backends/base.rb:61:in `start'
thin (1.2.11) lib/thin/server.rb:159:in `start'
rack (1.3.3) lib/rack/handler/thin.rb:13:in `run'
rack (1.3.3) lib/rack/server.rb:265:in `start'
railties (3.1.0) lib/rails/commands/server.rb:70:in `start'
railties (3.1.0) lib/rails/commands.rb:54:in `block in '
railties (3.1.0) lib/rails/commands.rb:49:in `tap'
railties (3.1.0) lib/rails/commands.rb:49:in `'
script/rails:6:in `require'
script/rails:6:in `

'