develooper Front page | perl.perl5.porters | Postings from August 2021

Re: "use v5.36.0" should imply UTF-8 encoded source

Thread Previous | Thread Next
From:
haj
Date:
August 3, 2021 10:27
Subject:
Re: "use v5.36.0" should imply UTF-8 encoded source
Message ID:
87fsvq3jtn.fsf@hajtower
Dan Book <grinnz@gmail.com> writes:

> On Mon, Aug 2, 2021 at 4:28 PM Harald Jörg <haj@posteo.de> wrote:
>
> >  Dan Book <grinnz@gmail.com> writes:
> >
> >  > DBD::MariaDB, DBD::SQLite, and DBD::Pg are used with the unicode
> >  > option in any modern programs. Thus they expect decoded strings.
> >
> >  As far as DBD::SQLite is concerned, this is only half-true.  In the
> >  current version 1.70 there have been changes how to declare unicode
> > handling, but even with DBD_SQLITE_STRING_MODE_UNICODE_STRICT you can
> > feed it UTF-8 encoded byte sequences and it "just works" (but maybe
> > shouldn't).
> > [...]
> I don't think this is correct. Mojo::SQLite has many tests to ensure
> in unicode-mode that it treats strings consistently.

Thanks for clarifying!  I compared your code to my failing tests (as
attached to https://github.com/DBD-SQLite/DBD-SQLite/issues/83) and
found that I fell victim to a typo in the DBD::SQLite docs:

  $dbh->{string_mode} = DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK;

That key should read $dbh->{sqlite_string_mode).  So, in effect, I ran
the test with the old (broken) default encoding which is known to fail.
-- 
Thanks again,
haj

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About