|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: My UTF-8 text isn't surviving I/O as expectedby choroba (Cardinal) |
| on Nov 23, 2024 at 20:40 UTC ( [id://11162852]=note: print w/replies, xml ) | Need Help?? |
|
You have correctly prepared the code to handle UTF-8 in the source code and input and output operations. What's missing is doing the same for the communication with the database. By default, DBD::SQLite uses a setting which is wrong (see the documentation for details). To fix it, only slight changes are needed:
PerlMonks is very old and its <code> sections can't handle Unicode. Either use <pre> instead, or replace unicode characters in the source code by their names:
BTW, get into the habit of using placeholders to insert values to prevent SQL injection:
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||