Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: pali [...] cpan.org
Cc: alex [...] chmrr.net
dagolden [...] cpan.org
AdminCc:

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



CC: dagolden [...] cpan.org, alex [...] chmrr.net
Encode::Unicode which provides UTF-16 and UTF-32 does not respect Encode::FB_WARN and Encode::WARN_ON_ERR check flags described at: https://metacpan.org/pod/Encode#Handling-Malformed-Data Test case for invalid UTF-32-LE string "\x78\x56\x34\x12": $ perl -MEncode -e 'decode("UTF-32-LE", "\x78\x56\x34\x12", Encode::WARN_ON_ERR | Encode::LEAVE_SRC)' No output, no warning was shown. Same for Encode::FB_WARN. But if lexical warnings are enabled (-w) then warning "Code point 0x12345678 is not Unicode, may not be portable" is thrown despite if FB_WARN/WARN_ON_ERR is set or not. So module totally ignores Encode::WARN_ON_ERR flag. Related commits: https://github.com/dankogai/p5-encode/commit/a6c2ba385875c2c03bd42350e23aef0188fb23b0 https://github.com/dankogai/p5-encode/commit/07c8adb58e55c7cf66b3d6673bf50010fe1a69ea
On Sat Mar 04 15:42:48 2017, PALI wrote: Show quoted text
> Encode::Unicode which provides UTF-16 and UTF-32 does not respect > Encode::FB_WARN and Encode::WARN_ON_ERR check flags described at: > https://metacpan.org/pod/Encode#Handling-Malformed-Data > > Test case for invalid UTF-32-LE string "\x78\x56\x34\x12": > $ perl -MEncode -e 'decode("UTF-32-LE", "\x78\x56\x34\x12", Encode::WARN_ON_ERR | Encode::LEAVE_SRC)' > > No output, no warning was shown. Same for Encode::FB_WARN. > > But if lexical warnings are enabled (-w) then warning "Code point > 0x12345678 is not Unicode, may not be portable" is thrown despite if > FB_WARN/WARN_ON_ERR is set or not. So module totally ignores > Encode::WARN_ON_ERR flag. > > Related commits: > https://github.com/dankogai/p5-encode/commit/a6c2ba385875c2c03bd42350e23aef0188fb23b0 > https://github.com/dankogai/p5-encode/commit/07c8adb58e55c7cf66b3d6673bf50010fe1a69ea
Fixed in Encode 2.99, UTF-16 and UTF-32 warnings are printed based on FB_WARN/WARN_ON_ERR flags.
On Sat Jul 25 09:25:21 2020, PALI wrote: Show quoted text
> On Sat Mar 04 15:42:48 2017, PALI wrote:
> > Encode::Unicode which provides UTF-16 and UTF-32 does not respect > > Encode::FB_WARN and Encode::WARN_ON_ERR check flags described at: > > https://metacpan.org/pod/Encode#Handling-Malformed-Data > > > > Test case for invalid UTF-32-LE string "\x78\x56\x34\x12": > > $ perl -MEncode -e 'decode("UTF-32-LE", "\x78\x56\x34\x12", > > Encode::WARN_ON_ERR | Encode::LEAVE_SRC)' > > > > No output, no warning was shown. Same for Encode::FB_WARN. > > > > But if lexical warnings are enabled (-w) then warning "Code point > > 0x12345678 is not Unicode, may not be portable" is thrown despite if > > FB_WARN/WARN_ON_ERR is set or not. So module totally ignores > > Encode::WARN_ON_ERR flag. > > > > Related commits: > > https://github.com/dankogai/p5- > > encode/commit/a6c2ba385875c2c03bd42350e23aef0188fb23b0 > > https://github.com/dankogai/p5- > > encode/commit/07c8adb58e55c7cf66b3d6673bf50010fe1a69ea
> > Fixed in Encode 2.99, UTF-16 and UTF-32 warnings are printed based on > FB_WARN/WARN_ON_ERR flags.