Hi,
what does the psql driver expect as input? A UTF-8 encoded string?
When you do the following:
you see, that after decoding JSON you get probably strings which are marked as unicode. As soon as you are using "output" of these strings (a database is one of the many output channels) you have to asked which encoding is expected. That means: If psql expects UTF-8 encoding you have to encode the string appropriately with Encode::encode('UTF-8', $string);#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use JSON; my $json = q({"my": "En d\u00e9mocratie, on a le droit d'avoir tort"}) +; my $perl = decode_json $json; my $flag_utf8 = utf8::is_utf8($perl->{'my'}) ? 1 : 0; print "is unicode: $flag_utf8\n"; print Dumper($perl), "\n";
McA
In reply to Re: PgPP invalid byte seqnence for encoding UTF8
by McA
in thread PgPP invalid byte seqnence for encoding UTF8
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |