The point about the source code is to do with your test code. What ends up in the database depends on a) the encoding of the source file and b) the locale your perl runs under. If Perl assumes the source is in a locale-specific 8-bit encoding, it will take the string’s bytes verbatim from the source code and put them in a non-UTF-8 string. Which means the bytes you have in your source would end up in the database.
But it’s a different question what happens when you stuff user input there. That too depends on what locale Perl is running under (mostly, whether it’s UTF-8), but the other factor is which encoding the user’s input had, which is clearly not necessarily the same as the encoding of your source code.
And whether entering text directly into the database from the console works correctly depends on what encoding your terminal emulator produces your input as, and what locale the commandline database utility runs under.
(Can you tell why I so wish everything was UTF-8 already? Layers upon layers, this is an onion of opportunities to screw up…)
Makeshifts last the longest.
|