elasticsearch/logstash — pull request #1155 by colinsurprenant (2014-03-08 00:47:09+00:00)
Title: actually encode to UTF-8 when input charset is non UTF-8 + basic specs

I decided to go with an early return structure. I am not usually a fan unless the return condition(s) are at the beginning of the method and doing so removes unnecessary nesting. IMHO it is easier to read, but this is subjective and debatable :P