-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
insane nonsense to make decode_utf8 barf as needed
- Loading branch information
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5ec644d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which version of Encode.pm were you testing with? Encode before 2.53 used to handle argument differently in
decode_utf8
depending on the utf-8 flag. With the current version, it croaks correctly even when$yaml
has a utf-8 flag (with latin-1 string in it).To make it work with the earlier version of Encode, you might need to use
decdoe("utf-8", $yaml, FB_CROAK|LEAVE_SRC)
.5ec644d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using 2.52, which is what was in 5.19.3. I will give it go.
FWIW, I tried futzing with the utf8 flag, and couldn't get that, alone, to change the croaking-ness.
Anyway, this is a temporary measure, so maybe I won't do much about it yet. Sure did make me 😕 though.
5ec644d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Encode 2.52, i can make it croak either by a)
utf8::downgrade
to remove the utf-8 flag or b) Usedecode("utf-8")
instead ofdecode_utf8
. HTH.