| | 6 | |
|---|
| | 7 | # Move some tests from TMAIL here |
|---|
| | 8 | def test_unquote_quoted_printable |
|---|
| | 9 | a ="=?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?=" |
|---|
| | 10 | b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') |
|---|
| | 11 | assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b |
|---|
| | 12 | end |
|---|
| | 13 | |
|---|
| | 14 | def test_unquote_base64 |
|---|
| | 15 | a ="=?ISO-8859-1?B?WzE2NjQxN10gQmVrcuZmdGVsc2UgZnJhIFJlanNlZmViZXI=?=" |
|---|
| | 16 | b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') |
|---|
| | 17 | assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b |
|---|
| | 18 | end |
|---|
| | 19 | |
|---|
| | 20 | def test_unquote_without_charset |
|---|
| | 21 | a ="[166417]_Bekr=E6ftelse_fra_Rejsefeber" |
|---|
| | 22 | b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') |
|---|
| | 23 | assert_equal "[166417]_Bekr=E6ftelse_fra_Rejsefeber", b |
|---|
| | 24 | end |
|---|
| | 25 | |
|---|
| | 26 | def test_unqoute_multiple |
|---|
| | 27 | a ="=?utf-8?q?Re=3A_=5B12=5D_=23137=3A_Inkonsistente_verwendung_von_=22Hin?==?utf-8?b?enVmw7xnZW4i?=" |
|---|
| | 28 | b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') |
|---|
| | 29 | assert_equal "Re: [12] #137: Inkonsistente verwendung von \"Hinzuf\303\274gen\"", b |
|---|
| | 30 | end |
|---|
| | 31 | |
|---|
| | 32 | def test_unqoute_in_the_middle |
|---|
| | 33 | a ="Re: Photos =?ISO-8859-1?Q?Brosch=FCre_Rand?=" |
|---|
| | 34 | b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') |
|---|
| | 35 | assert_equal "Re: Photos Brosch\303\274re Rand", b |
|---|
| | 36 | end |
|---|
| | 37 | |
|---|
| | 38 | def test_unqoute_iso |
|---|
| | 39 | a ="=?ISO-8859-1?Q?Brosch=FCre_Rand?=" |
|---|
| | 40 | b = TMail::Unquoter.unquote_and_convert_to(a, 'iso-8859-1') |
|---|
| | 41 | assert_equal "Brosch\374re Rand", b |
|---|
| | 42 | end |
|---|
| | 43 | |
|---|