The current charset coercion code, while nice, can be a bit heavy handed and is just wrong in certain circumstances. In order to get ready for 1.0 I would like to add the following enhancements:
I make some hacks that make patron more stable
def determine_charset(header_data, body)
header_data.match(charset_regex) || (body && body.match(charset_regex))
encoding = CharDet.detect(body)
encoding[:encoding].name.upcase rescue nil
super(str) rescue nil
I am in the process of rewriting the charset coercion code and will probably use this or something very like it.