Fetch icon indicating copy to clipboard operation
Fetch copied to clipboard

Generalize charset converting

Open linniksa opened this issue 10 years ago • 4 comments

linniksa avatar Aug 28 '15 13:08 linniksa

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).

adriansuter avatar Sep 26 '15 22:09 adriansuter

+1 on this. @tedivm please merge it. @linniksa provided very good solution of this problem.

wiiiteek avatar Jan 26 '16 11:01 wiiiteek

https://github.com/ApexWire/Fetch/releases/tag/v0.8.0

ApexWire avatar Apr 15 '16 15:04 ApexWire

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'
    ));

klammbueddel avatar Apr 18 '16 09:04 klammbueddel