Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 14559
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: Ruslan.Zakirov [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 2.10
  • 2.11
  • 2.12
Fixed in: (no value)



Subject: fix for #8872 introduces new "bug"
Fix for http://rt.cpan.org/NoAuth/Bug.html?id=8872 doesn't allow to use strings with UTF-8 flag as decode_utf8 argument: $ perl -MEncode -we 'decode_utf8("\x{100}")' Cannot decode string with wide characters at /usr/lib/perl5/5.8.7/x86_64-linux/Encode.pm line 166. This behaviour is not documented and also is not consistent with encode_utf8 that doesn't die when string has no UTF-8 flag. -- Best regards. Ruslan.
On Mon Sep 12 16:48:04 2005, RUZ wrote: Show quoted text
> Fix for http://rt.cpan.org/NoAuth/Bug.html?id=8872 doesn't allow to > use strings with UTF-8 flag as decode_utf8 argument: > > $ perl -MEncode -we 'decode_utf8("\x{100}")' > Cannot decode string with wide characters at > /usr/lib/perl5/5.8.7/x86_64-linux/Encode.pm line 166. > > This behaviour is not documented and also is not consistent with > encode_utf8 that doesn't die when string has no UTF-8 flag. > > -- > Best regards. Ruslan.
Sorry for my slow response. The patch below fix the problem. diff -u -r2.12 Encode.pm --- Encode.pm 2005/09/08 14:17:17 2.12 +++ Encode.pm 2006/01/15 14:34:41 @@ -200,6 +199,7 @@ sub decode_utf8($;$) { my ($str, $check) = @_; + return $str if is_utf8($str); if ($check){ return decode("utf8", $str, $check); }else{ This fix will be a part of Encode 2.13. Dan the Encode Maintainer