Bug 1092015
| Summary: | mojomojo-1.10-2.fc21 FTBFS | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Petr Pisar <ppisar> | ||||
| Component: | mojomojo | Assignee: | Petr Pisar <ppisar> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 20 | CC: | iarnell, perl-devel | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| URL: | https://github.com/mojomojo/mojomojo/issues/121 | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | mojomojo-1.10-3.fc21 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-07-02 13:17:22 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1000256 | ||||||
| Attachments: |
|
||||||
|
Description
Petr Pisar
2014-04-28 13:59:50 UTC
The test is:
$test = 'Unicode wikilinks';
my $unicode_string = 'განეკუთვნება';
$content = "[[$unicode_string]]";
$mech->post('/.jsrpc/render', { content => $content });
$mech->content_is(<<"HTML", $test);
<p><span class="newWikiWord"><a title="Not found. Click to create this page." href="/$unicode_string.edit">$unicode_string?</a></span></p>
HTML
The Encode::decode_utf8() complains on:
"\x{10d2}\x{10d0}\x{10dc}\x{10d4}\x{10d9}\x{10e3}\x{10d7}\x{10d5}\x{10dc}\x{10d4}\x{10d1}\x{10d0}"
$ perl -MEncode -e 'decode_utf8(qq{\x{10d2}\x{10d0}\x{10dc}\x{10d4}\x{10d9}\x{10e3}\x{10d7}\x{10d5}\x{10dc}\x{10d4}\x{10d1}\x{10d0}}, 1)'
Cannot decode string with wide characters at /usr/lib64/perl5/vendor_perl/Encode.pm line 215.
The \x{} notation corresponds to the 'განეკუთვნება' string.
It looks like the unicode string is double-decoded, second decoding is performed on string with UTF-8 flag up instead of on bit-stream.
This bug is triggered by upgrading Encode from 2.52 to 2.53, more precisely by commit:
commit ff65c71aa64c0efd285e6905ac68ba4e2cb25541
Author: Tatsuhiko Miyagawa <miyagawa>
Date: Sun Aug 25 19:02:16 2013 -0700
Do not short-circuit decode_utf8 with utf8 flags
diff --git a/Encode.pm b/Encode.pm
index aea404a..5cee760 100644
--- a/Encode.pm
+++ b/Encode.pm
@@ -209,7 +209,6 @@ my $utf8enc;
sub decode_utf8($;$) {
my ( $octets, $check ) = @_;
- return $octets if is_utf8($octets);
return undef unless defined $octets;
$octets .= '' if ref $octets;
$check ||= 0;
The former behavior was to return success on UTF-8-flagged string immediately. Now, it checks the argument is correct UTF-8 byte-string.
Reported to mojomojo upstream as <https://github.com/mojomojo/mojomojo/issues/121>. Fedora 20 is affected too. Created attachment 890741 [details]
Prpoposed fix
mojomojo-1.10-3.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mojomojo-1.10-3.fc20 mojomojo-1.10-3.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. |