[Israel.pm] Re: utf-8 and character semantics
eitan.schuler at gmail.com
Wed Jan 18 09:09:03 PST 2006
I have the following problem:
I select records from a table using dbi. I would like to manipulate
the selected data in the memory, and write it back.
So far no problem.
The database is utf-8. The manipulation, I must do includes isolating
a specific number of bytes (!) in a field.
I know for sure that this number of bytes I use in a substr is
coordinated well to the utf-8 wide character boundaries.
The question is: how can I make sure that substr will relate to number
of bytes and not to number of characters? Is use bytes(); enough? Can
I force 8 bit ascii retrieve from the db?
If I consistently use 8 bit ascii when reading and writing back (if
it's possible) I shouldn't destroy anything? Any ideas?
"Computer Science is no more about computers than astronomy is about
telescopes." (Edsger Wybe Dijkstra)
More information about the Perl