diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
commit | 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (patch) | |
tree | 96922ad4459eda1e649327fd391d60c58d454c53 /rt/t/api/i18n_mime_encoding.t | |
parent | 4f5619288413a185e9933088d9dd8c5afbc55dfa (diff) |
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/t/api/i18n_mime_encoding.t')
-rw-r--r-- | rt/t/api/i18n_mime_encoding.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/rt/t/api/i18n_mime_encoding.t b/rt/t/api/i18n_mime_encoding.t new file mode 100644 index 000000000..5ad532ed2 --- /dev/null +++ b/rt/t/api/i18n_mime_encoding.t @@ -0,0 +1,32 @@ +use warnings; +use strict; + +use RT::Test nodata => 1, tests => undef; +use RT::I18N; +use Test::Warn; + +diag "normal mime encoding conversion: utf8 => iso-8859-1"; +{ + my $mime = MIME::Entity->build( + Type => 'text/plain; charset=utf-8', + Data => ['À中文'], + ); + + warning_like { + RT::I18N::SetMIMEEntityToEncoding( $mime, 'iso-8859-1', ); + } + [ qr/does not map to iso-8859-1/ ], 'got one "not map" error'; + is( $mime->stringify_body, 'À中文', 'body is not changed' ); + is( $mime->head->mime_attr('Content-Type'), 'application/octet-stream' ); +} + +diag "mime encoding conversion: utf8 => iso-8859-1"; +{ + my $mime = MIME::Entity->build( + Type => 'text/plain; charset=utf-8', + Data => ['À中文'], + ); + is( $mime->stringify_body, 'À中文', 'body is not changed' ); +} + +done_testing; |