Commit b1af637a authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Update POD and comments to be clearer about characters vs bytes

parent 9cc181ba
......@@ -1129,7 +1129,8 @@ sub PseudoReference {
=head2 SetHeaderAsEncoding($field_name, $charset_encoding)
This routine converts the field into specified charset encoding.
This routine converts the field into specified charset encoding, then
applies the MIME-Header transfer encoding.
=cut
......
......@@ -330,14 +330,8 @@ sub SetMIMEEntityToEncoding {
=head2 DecodeMIMEWordsToUTF8 $raw
An utility method which mimics MIME::Words::decode_mimewords, but only
limited functionality. This function returns an utf-8 string.
It returns the decoded string, or the original string if it's not
encoded. Since the subroutine converts specified string into utf-8
charset, it should not alter a subject written in English.
Why not use MIME::Words directly? Because it fails in RT when I
tried. Maybe it's ok now.
limited functionality. Despite its name, this function returns the
bytes of the string, in UTF-8.
=cut
......
......@@ -375,10 +375,9 @@ sub IsOverride {
Returns L<MIME::Entity> object parsed using L</Parse> method. Returns
undef if last call to L</Parse> failed or never be called.
Note that content of the template is UTF-8, but L<MIME::Parser> is not
good at handling it and all data of the entity should be treated as
octets and converted to perl strings using Encode::decode_utf8 or
something else.
Note that content of the template is characters, but the contents of all
L<MIME::Entity> objects (including the one returned by this function,
are bytes in UTF-8.
=cut
......
......@@ -4,7 +4,6 @@ use warnings;
use RT::Test tests => 9;
use Encode;
# \x{XX} where XX is less than 255 is not treated as unicode code point
my $subject = Encode::decode('latin1', "Sujet accentu\x{e9}");
my $text = Encode::decode('latin1', "Contenu accentu\x{e9}");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment