Courage has asked for the wisdom of the Perl Monks concerning the following question:
Please advice on my hopefully simple following question.
Modern perls have an "UTF8" flag attached for each scalar. perldoc perlunicode clearly states this.
There are functions to convert to/from utf8 in place, and there are functions that just set on or off "UTF8" flag
But how do I distinguish whether or not should I treat a data as Unicode returned from some C library?
As an example, sssume I had few scalars written into database, some of them just binary data, some are Unicode, and after that I get my scalars back from DB. How do I distinguish which is simply binary and which is Unicode?
Should I always store "utf8-ness" information always with my scalars?
Is there exists a better and cleaner way?
Thanks in advance,
Courage, the Cowardly Dog
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to recognize Unicode data received from any C library?
by liz (Monsignor) on Aug 24, 2003 at 20:18 UTC | |
by Courage (Parson) on Aug 24, 2003 at 20:26 UTC |