support nil charset

noticed nil failing when dropping the 772 fix into our mail parser project

@bf4 
In the implementation you're casting `nil.to_s`.  `Encoding.find(nil)` raises a `TypeError`, but `Encoding.find('')` raises an `ArgumentError`.  I'd argue that since you're handling the nil case as empty string, your test should be empty string, and thus you don't need to affix `if from` (which I generally don't like at the end of long statements)