Issue #7 new

"invalid byte sequence in US-ASCII" when setting Linguistics.use( :en )

created an issue

Let me start of by saying that I don't even know if this is an issue with Linguistics itself, but it only happens to me when I use this gem, so I figured I should report it just in case.

The issue can be fixed by adding

if RUBY_VERSION =~ /1.9/
  Encoding.default_external = Encoding::UTF_8
  Encoding.default_internal = Encoding::UTF_8

to the top of your Gemfile. If I don't add that I get "invalid byte sequence in US-ASCII" when trying to use Linguistics in my web apps. This was also the case for the old 1.0.9 version. It happens with both Ruby 1.9 and 2.0.

Comments (1)

  1. Michael Granger repo owner

    I suspect this happens because I'm missing encoding declarations in the source files. I'll add them to all the files, which should (I think) make your workaround unnecessary.

    Thanks for reporting this!

  2. Log in to comment