THANK YOU!! That cleared up a lot. I didn't even suspect that the culprit was sqlite.

I still have trouble reading UTF-8 from command line arguments. I assume this is not a Perl issue; any suggestions how to fix?

#!/usr/bin/env perl
use v5.40;
use utf8;
use open qw(:std :encoding(UTF-8));

my $utf8_text1 = shift;
say "A variable set from argument on command line";
show ($utf8_text1);

my $utf8_text2 = 'Åke Lindström;
say "A variable set to UTF8 literal";
show($utf8_text2);

chomp (my $utf8_text3 = <>);
say "A variable set by reading from STDIN";
show($utf8_text3);

sub show($str) {
    say "Binary:      ", join ' ', (unpack "H*", $str) =~ m/../g ;
    say "Text>STDOUT: $str";
}
Output:
$ echo "Åke Lindström" | u 'Åke Lindström'
A variable set from argument on command line
Binary:      c3 85 6b 65 20 4c 69 6e 64 73 74 72 c3 b6 6d
Text>STDOUT: Åke Lindström
A variable set to UTF8 literal
Binary:      c5 6b 65 20 4c 69 6e 64 73 74 72 f6 6d
Text>STDOUT: Åke Lindström
A variable set by reading from STDIN
Binary:      c5 6b 65 20 4c 69 6e 64 73 74 72 f6 6d
Text>STDOUT: Åke Lindström

In reply to Re^2: My UTF-8 text isn't surviving I/O as expected by ibm1620
in thread My UTF-8 text isn't surviving I/O as expected by ibm1620

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.