Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

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

People
Owner: DANKOGAI [...] cpan.org
Requestors: bjoern [...] hoehrmann.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.02
Fixed in: (no value)



Subject: Encoding names should be case-insensitive
Hi, perl -MEncode -e "print decode('UTF-16LE', '')" perl -MEncode -e "print decode('utf-16le', '')" Unknown encoding 'utf-16le' at -e line 1 perl -MEncode -e "print decode('MIME-Q', '')" perl -MEncode -e "print decode('MiME-Q', '')" Unknown encoding 'MiME-Q' at -e line 1 perl -MEncode -e "print decode('eUc-Cn', '')" perl -MEncode -e "print decode('euc-cn', '')" ... IOW, for some encodings the name is treated case-sensitive, for other encodings it is case-insensitive. This is sub-optimal design as you never really know which spelling would be correct (canonical names are all-lowercase, MixedCase, UPPERCASE, etc) and usually these names are considered case-insensitive, so it seems to be a bug to consider e.g. "utf-16le" unsupported if uc("utf-16le") is supported.
[BJOERN - Thu Sep 30 18:33:54 2004]: Show quoted text
> IOW, for some encodings the name is treated case-sensitive, for other > encodings it is case-insensitive. This is sub-optimal design as you > never really know which spelling would be correct (canonical names > are all-lowercase, MixedCase, UPPERCASE, etc) and usually these > names are considered case-insensitive, so it seems to be a bug to > consider e.g. "utf-16le" unsupported if uc("utf-16le") is > supported.
They were supposed to be case insensitive. And they were for most cases -- that is, whenever the canonical encoding was in all lowercase. Such encodings as MacSomething, MIME-* slipped from aliasing. As for "UTF-16LE", it was not case per se; the canonical name was "UTF16-LE", no hyphen between "UTF" and "16". So it was a regex bug which failed to strip '-'. I have fixed the bug in my repository so it'll be fixed in next encode. Dan the Maintainer Thereof