Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a library that is returning a scalar to me that incorrectly has its utf8 flag set. The scalar contains "binary" data that should not be treated as utf8.
I want to use length() and print() on the scalar.
Assuming I can't fix the broken library code, what is the best way to handle this? Do I "use bytes"? Do I turn off the utf8 flag (via Encode or pack)? Are there other ways to deal with this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: deal with incorrectly set utf8 flag
by ikegami (Patriarch) on Mar 27, 2009 at 16:15 UTC | |
by Anonymous Monk on Mar 27, 2009 at 16:37 UTC | |
by ikegami (Patriarch) on Mar 27, 2009 at 16:40 UTC | |
by Anonymous Monk on Mar 27, 2009 at 16:48 UTC | |
by ikegami (Patriarch) on Mar 27, 2009 at 16:53 UTC |