Skip to content

commit bacaeb095f..., 'fix invalid byte sequence...' breaks gem on ruby 1.8.x #8

@stepheneb

Description

@stepheneb

The new code in question is:

open(filename, :encoding=>"utf-8") do |file|

the error reported is:

open-uri.rb:32:in `initialize': can't convert Hash into String (TypeError)

The same error occurs using File.open:

File.open(filename, :encoding=>"utf-8") do |file|

Presumably this only works in Ruby 1.9. I'm building Ruby 1.9 now to check. In the latest Pickaxe book this is the method described for setting the encoding to utf-8 when using File.open:

File.open(filename, 'r:utf-8')

This method also doesn't work in 1.8.x

Also see comments on this commit:

http://github.com/fauna/has_many_polymorphs/commit/bacaeb095f5e8cf7427679b2755680ab24f8503e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions