Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading definition file fails when Encoding.default_internal is not UTF-8 #94

Closed
static-max opened this issue Feb 15, 2016 · 3 comments
Closed
Assignees
Labels

Comments

@static-max
Copy link

I'm forced to use ASCII-8BIT as internal and external encoding in my application. When I try to parse an URI, I get an error:

U+00E9 from UTF-8 to ASCII-8BIT lib/public_suffix/list.rb:79

def self.default_definition
  File.open(DEFAULT_DEFINITION_PATH, "r:utf-8") { |f| f.read }
end

When I remove the utf-8 file encoding from File.open, the parsing seems to work as intended. Is the forced UTF-8 encoding needed? I did not find an Umlaut TLD in the definitions file.

@weppos
Copy link
Owner

weppos commented Feb 15, 2016

@static-max it was for pre-2.0 Ruby versions. Given I don't support Ruby 1.9 anymore I can probably remove it as it's the default now.

I honestly can't guarantee that being forced to use ASCII-8BIT will not cause you some other troubles.

@weppos weppos self-assigned this Feb 15, 2016
@weppos weppos closed this as completed in f21b23b Feb 15, 2016
@weppos weppos added the bug label Feb 15, 2016
@weppos
Copy link
Owner

weppos commented Feb 15, 2016

Changed. Travis is Happy, hence I'm happy too. 👍
https://travis-ci.org/weppos/publicsuffix-ruby

I'll deploy this change along with the various other pending changes in the upcoming release.

@static-max
Copy link
Author

Hi Simone,

great, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants