Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 123921
Status: open
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: ashley [...] cpan.org
Cc:
AdminCc:

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



Subject: Encode::Alias should respect single spaces in encoding names
Regarding "Since there is no space in encoding names or aliases" from this fix- sub getEncoding { ... $name =~ s/\s+//g; # https://rt.cpan.org/Ticket/Display.html?id=65796 Some standards--in my use case, the DICOM standard--do contain spaces: https://www.dabsoft.ch/dicom/3/C.12.1.1.2/ For example, "ISO-IR 126" is analogous to "iso-8859-7". In my view this should work- define_alias( "ISO-IR 126", "iso-8859-7" ); It's obviously possible to code around with preprocessing the DICOM encoding name but it doesn't seem sensible to me to have to do so. It's trivial to fix and I don't think it will cause a regression of the segfaults from the original ticket- $name =~ s/\s+/ /g; THANK YOU for your consideration.
On Wed Dec 20 12:41:38 2017, ASHLEY wrote: Show quoted text
> Regarding "Since there is no space in encoding names or aliases" from > this fix- > > sub getEncoding { > ... > $name =~ s/\s+//g; # > https://rt.cpan.org/Ticket/Display.html?id=65796 > > Some standards--in my use case, the DICOM standard--do contain spaces: > https://www.dabsoft.ch/dicom/3/C.12.1.1.2/ > > For example, "ISO-IR 126" is analogous to "iso-8859-7". In my view > this should work- > > define_alias( "ISO-IR 126", "iso-8859-7" ); > > It's obviously possible to code around with preprocessing the DICOM > encoding name but it doesn't seem sensible to me to have to do so. > It's trivial to fix and I don't think it will cause a regression of > the segfaults from the original ticket- > > $name =~ s/\s+/ /g; > > THANK YOU for your consideration.
Won’t this cause problems for people who write 'iso 8859 1'?
Thanks for looking! An admittedly casual test with "iso 8859 7" in my script says, no, the behavior does not change between the current code and my fix. And I argue that that usage, without declaring it as an alias, is relying on broken/undefined behavior and should not necessarily be supported even if it happens to work. I also argue standards trump personal idiom, though in this case, both seem compatible. There is no logical reason to disallow spaces in aliases. The only reason they are now is because of a bugfix for an edge case + an erroneous assumption that no standards use spaces.