Generalize charset converting
Commit confirmed. Needed this, as in the old version, charset "windows-1252" (sent by my Windows Phone Mail Client) would not be recognized as being "Windows-1252" (as returned by mb_list_encodings() at line 526).
+1 on this. @tedivm please merge it. @linniksa provided very good solution of this problem.
https://github.com/ApexWire/Fetch/releases/tag/v0.8.0
I just ran into an issue, where a 10K e-mail could not be converted because only 2 Bytes failed the mb_check_encoding function due to invalid characters. I think it is safe to just call mb_convert_encoding and hope the best instead of converting nothing.
$this->assertSame('?これ', Message::charsetConvert(
implode(array_map('chr', array(0x1B, 0x24, 0x42, 0x2D, 0x21, 0x24, 0x33, 0x24, 0x6C, 0x1B, 0x28, 0x42))),
'iso-2022-jp',
'utf-8'
));