basho/riak_kv — pull request #609 by arcusfelis (2013-07-26 14:52:34+00:00)
Title: Passing to mochiweb:encode/1 a valid UTF-8 string (not latin1).

The old code sometimes calls `mochijson2:encode/1` with a wrong argument.
For example, here is a minimized version `mochijson2:encode({struct,[{input,<<"òB">>}]}).`.
This code fails with the reason `{ucs,{bad_utf8_character_code}}`, because `<<"òB">>` is not a valid UTF-8 string.
This PR fixes this error.