logstash/logstash — pull request #842 by jordansissel (2013-12-05 23:00:29+00:00)
Title: Force the default string encoding to be UTF-8.

This helps solve this common problem:

- User environment is LANG=C (Ruby says US-ASCII)
- User sends JSON with non-english characters like "Andrés" (e with
accent).
- The above two things clash, since 'é' in bytes is 0xc3 0xa9, you will
get Encoding::InvalidByteSequenceError.

You can reproduce this theory simply in ruby as:

>> "é".force_encoding("US-ASCII").encode("UTF-8")
Encoding::InvalidByteSequenceError: "\xC3" on US-ASCII

This change *should* fix a big bucket of JIRA tickets related to
UTF-8-encoded text being sent to logstash which was incorrectly
defaulting to US-ASCII encoding.