Skip to content

Ruby19#2

Open
gilles wants to merge 2 commits into
ealdent:masterfrom
gilles:ruby19
Open

Ruby19#2
gilles wants to merge 2 commits into
ealdent:masterfrom
gilles:ruby19

Conversation

@gilles

@gilles gilles commented Feb 16, 2011

Copy link
Copy Markdown

Hi,

The current gem does not work with ruby 1.9.X. because of encoding issues (even though the file is ISO-8859-1 the default IO seems to be ASCII-8BIT)

Here is the first phase of a possible fix.

The tests still fails because of
RegexpError:
invalid multibyte escape: /^Der gro\xdfe BilderSauger.*?$/

I don't have a solution for this one yet.

I found a thread of ruby-forum which said to replace

@@user_agent_regexps[section] = Regexp.new("^%s$" % regexp)

with

@@user_agent_regexps[section] = Regexp.new("^%s$" % regexp, nil, 'n')

it works with warnings but this is undocumented black magic, I don't really like it.

If you have a solution for the second phase that would be awesome :)

Thanks

--Gilles

@gilles

gilles commented Feb 16, 2011

Copy link
Copy Markdown
Author

I think I found it.
Please note that this requires 'inifile' ~> 0.4.0 which handles encoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant