1nickt has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I've run into an issue with sending UTF-8 to Postgres, using DBIx::Class and DBD::Pg.
Using DBIC_TRACE=1:
INSERT INTO method_data ( method_id, params) VALUES ( ?, ? ) RETURNING method_data_id: '59807', '{"addressLine1":"堅尼地道105號","ms-correlationid":"D2559182-719E-11E9-9E71-271EACAC0E00","city":"灣仔","country":"HK","user":"ut-testadmin"}'Using DBI_TRACE:
-> bind_param for DBD::Pg::st (DBI::st=HASH(0x7f982408c7f0)~0x7f982408d2b8 1 59813 undef) <- bind_param= ( 1 ) 1 items at DBI.pm line 1891 -> bind_param for DBD::Pg::st (DBI::st=HASH(0x7f982408c7f0)~0x7f982408d2b8 2 '{"addressLine1":"�.尼�.��..105�..","country":"HK","city":"�.��.","ms-correlationid":"019A09E2-71A3-11E9-971A-C122ACAC0E00","user":"ut-testadmin"}' undef)Making the query shown by DBIC_TRACE in the CLI succeeds normally.
Is this a known problem? I couldn't find much on the interwebs about it. I don't see anything in the source for DBD::Pg concerning encoding: are the C libs doing something under the hood?
Thanks in advance.
The way forward always starts with a minimal test.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Postgres UTF-8 woes
by choroba (Cardinal) on May 08, 2019 at 18:57 UTC | |
by 1nickt (Canon) on May 08, 2019 at 21:13 UTC | |
by choroba (Cardinal) on May 09, 2019 at 08:04 UTC | |
by 1nickt (Canon) on May 09, 2019 at 10:40 UTC | |
Re: Postgres UTF-8 woes
by erix (Prior) on May 08, 2019 at 21:48 UTC | |
by 1nickt (Canon) on May 08, 2019 at 22:56 UTC | |
by 1nickt (Canon) on May 09, 2019 at 11:40 UTC |
Back to
Seekers of Perl Wisdom