Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Fixing utf8 errorsby graff (Chancellor) |
on Oct 31, 2015 at 04:07 UTC ( [id://1146553]=note: print w/replies, xml ) | Need Help?? |
Can you define or describe what "bad encoding (for my purposes)" refers to? Can you provide or describe a few samples of "bad encoding" and "ok encoding"?
Is the string that is passed to "_checkit" supposed to be a (perl-internal) UTF8 string? Has STDOUT been set to use UTF8 encoding before "_checkit" is called? When the error message from a failed eval matches /U\+(\S+)/, what is the full text of the error message? (Do you get error messages that don't match that regex, and if so, what are they?) Please be explicit. The point is that I don't understand what sort of error you're "catching". There probably is a better way to catch it, but since I don't know what you're dealing with, I don't know what to suggest. A few lines of code that reads a few lines of relevant __DATA__ and calls "_checkit" would answer most or all of my questions.
In Section
Seekers of Perl Wisdom
|
|