Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
best-practical
rt
Commits
b1af637a
Commit
b1af637a
authored
Aug 08, 2014
by
Alex Vandiver
Browse files
Update POD and comments to be clearer about characters vs bytes
parent
9cc181ba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
14 deletions
+7
-14
lib/RT/Action/SendEmail.pm
lib/RT/Action/SendEmail.pm
+2
-1
lib/RT/I18N.pm
lib/RT/I18N.pm
+2
-8
lib/RT/Template.pm
lib/RT/Template.pm
+3
-4
t/web/rest-non-ascii-subject.t
t/web/rest-non-ascii-subject.t
+0
-1
No files found.
lib/RT/Action/SendEmail.pm
View file @
b1af637a
...
...
@@ -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
...
...
lib/RT/I18N.pm
View file @
b1af637a
...
...
@@ -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
...
...
lib/RT/Template.pm
View file @
b1af637a
...
...
@@ -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
...
...
t/web/rest-non-ascii-subject.t
View file @
b1af637a
...
...
@@ -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}
");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment