Francisco - A potential fix for this bug is the latest version of erlang_js. erlang_js wasn't calling JS_CStringsAreUTF8() in the Spidermonkey API. This causes all kinds of interesting string mangling to occur and can trigger bad_encoding errors as well. You can either checkout the latest erlang_js and replace your existing version with the new copy or you can wait on Riak 0.11 and pick it up then.
--Kevin On Jun 6, 2010, at 12:23 PM, francisco treacy wrote: > I get {"error":"bad_encoding"} from map/reduce when I use non-ASCII > characters: > > ftreacy @ ~ > => curl -X PUT http://127.0.0.1:8098/riak/test/bug -H "Content-Type: > application/json" -d @- > {"city":"Buenos Aires"} > ^D > > ftreacy @ ~ > => curl -X POST http://localhost:8098/mapred -H "Content-Type: > application/json" -d @- > {"inputs":"test", > "query":[{"map":{"language":"javascript", > "source":"function(value, keyData, arg) { var data = > Riak.mapValuesJson(value)[0]; return [data]; }", > "keep":true}}] > } > [{"city":"Buenos Aires"}] > > ftreacy @ ~ > => curl -X PUT http://127.0.0.1:8098/riak/test/bug -H "Content-Type: > application/json" -d @- > {"city":"København"} > ^D > > ftreacy @ ~ > => curl http://127.0.0.1:8098/riak/test/bug > {"city":"København"} > > ftreacy @ ~ > => curl -X POST http://localhost:8098/mapred -H "Content-Type: > application/json" -d @- > {"inputs":"test", > "query":[{"map":{"language":"javascript", > "source":"function(value, keyData, arg) { var data = > Riak.mapValuesJson(value)[0]; return [data]; }", > "keep":true}}] > } > {"error":"bad_encoding"} > > > Should I escape UTF-8, or is this a bug? (Same behaviour using riak-js). > > "bug" is the only key in the "test" bucket. Using Riak 0.10.1 on Snow Leopard. > > Francisco > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com