Regards, Ruslan. From phone.
написал:
The branch, 4.0/dashboard-chart-with-umlauts has been created
at c6fb9f54c37142df0089145c12ab4feab52d7d27 (commit)
-
Log -----------------------------------------------------------------
commit c0ec1787729093b2064a36c9ef5cce5e84b763d5
Author: sunnavy sunnavy@bestpractical.com
Date: Mon Aug 8 17:31:41 2011 +0800
turn off utf8 as uri string is utf8 encoded, see also #18104
diff --git a/lib/RT/Dashboard/Mailer.pm b/lib/RT/Dashboard/Mailer.pm
index f6b1685…ae10d21 100644
— a/lib/RT/Dashboard/Mailer.pm
+++ b/lib/RT/Dashboard/Mailer.pm
@@ -476,7 +476,9 @@ sub BuildEmail {
}
sub GetResource {
- my $uri = URI->new(shift);
- my $string = shift;
- Encode::_utf8_off($string);
- my $uri = URI->new($string);
Shouldn’t uri be escaped and contain only ASCII? I see this masking real
issue.
my ($content, $filename, $mimetype, $encoding);
$RT::Logger->debug("Getting resource $uri");
commit c6fb9f54c37142df0089145c12ab4feab52d7d27
Author: sunnavy sunnavy@bestpractical.com
Date: Mon Aug 8 17:31:58 2011 +0800
test for dashboard chart with umlauts
diff --git a/t/mail/dashboard-chart-with-umlauts.t
b/t/mail/dashboard-chart-with-umlauts.t
Regards, Ruslan. From phone.
написал:
The branch, 4.0/dashboard-chart-with-umlauts has been created
at c6fb9f54c37142df0089145c12ab4feab52d7d27 (commit)
-
Log -----------------------------------------------------------------
commit c0ec1787729093b2064a36c9ef5cce5e84b763d5
Author: sunnavy sunnavy@bestpractical.com
Date: Mon Aug 8 17:31:41 2011 +0800
turn off utf8 as uri string is utf8 encoded, see also #18104
diff --git a/lib/RT/Dashboard/Mailer.pm b/lib/RT/Dashboard/Mailer.pm
index f6b1685…ae10d21 100644
— a/lib/RT/Dashboard/Mailer.pm
+++ b/lib/RT/Dashboard/Mailer.pm
@@ -476,7 +476,9 @@ sub BuildEmail {
}
sub GetResource {
- my $uri = URI->new(shift);
- my $string = shift;
- Encode::_utf8_off($string);
- my $uri = URI->new($string);
Shouldn’t uri be escaped and contain only ASCII? I see this masking real
issue.
yep, but those ascii with utf8 flag on makes URI interpret uri escaped utf8
encoded data differently, here is the detail:
“äöü” is escaped to “%C3%A4%C3%B6%C3%BC”
use Devel::StringInfo 'string_info';
my $uri = URI->new('?Query=%C3%A4%C3%B6%C3%BC');
print string_info( ($uri->query_form('Query'))[1] );
output:
string: äöü
is_utf8: 0
octet_length: 6
valid_utf8: 1
decoded_is_same: 0
decoded:
octet_length: 6
downgradable: 1
char_length: 3
string: äöü
is_utf8: 1
raw = <<äöü>>
this is right.
but if utf8 flag of “%C3%A4%C3%B6%C3%BC” is on:
use Encode;
use Devel::StringInfo 'string_info';
my $uri = URI->new(decode_utf8 '?Query=%C3%A4%C3%B6%C3%BC');
print string_info( ($uri->query_form('Query'))[1] );
output:
string: äöü
is_utf8: 1
char_length: 6
octet_length: 12
downgradable: 1
raw = <<äöü>>
this is not right, the char_length should be 3 and octet_length should be 6