sunspot/sunspot — Issue #117: Wrong encoding with faceted search
Author: Marchino
Created: 2011-11-02 16:25:53+00:00
State: open

I'm using sunspot for my app, and I'm running into a strange issue after upgrading from 1.2.0 to the latest RC from the master branch of the repo (no other changes to the app, just the Gemfile).

After running the bundle command i get

Using sunspot (1.3.0.rc3) from https://github.com/sunspot/sunspot.git (at master)
Using sunspot_rails (1.3.0.rc3) from https://github.com/sunspot/sunspot.git (at master)

which looks ok.

Everything looks and works fine until the search stumbles on a result with non ascii chars.

The error i get is

Encoding::UndefinedConversionError in BooksController#index "\xC3" from ASCII-8BIT to UTF-8

which points to somewhere in a helper where i just display the values of facets.

I checked the encoding of those values before and after the upgrade and they are different:
everything is on UTF-8 with 1.2 and everything is on ASCII-8BIT with 1.3

Does anyone have and idea about what's going on?

Thank you

Marco