Updating from old version

8 views
Skip to first unread message

Chuck Zumbrun

unread,
Mar 3, 2022, 3:03:37 PM3/3/22
to Rose::DB::Object
I'm updating an old installation on Ubuntu 12.04.5, running Perl 5.14.2 and Rose::DB 0.770 to Ubuntu 20.04, running Perl 5.30 and Rose::DB 0.783.  Using Postgresql 12.9

In the new setup when I save strings to the database that contain extended characters the extended characters are corrupted.  This doesn't happen with the old setup. 

I use Rose::DB as described in the Rose::DB::Object tutorial, with subclasses derived from Rose::DB::Object, so when I do something with extended characters, like:

$p = Product->new(name => '“quotes”' );
$p->save;

what I see in the postgresql log file and in the db is  'â��quotesâ��',

The old setup, writing to the same database, doesn't do this, extended characters are saved correctly.

Any ideas? It seems I must be missing an encoding setting somewhere.

John Siracusa

unread,
Mar 3, 2022, 4:33:17 PM3/3/22
to rose-db-object
Hard to say without testing the code in question. Maybe look at the pg_enable_utf8 parameter?


-John

--
Source: https://github.com/siracusa/rose
CPAN: http://search.cpan.org/dist/Rose-DB-Object
---
You received this message because you are subscribed to the Google Groups "Rose::DB::Object" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rose-db-objec...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rose-db-object/113d860a-0eab-4a84-9017-c03df565bf01n%40googlegroups.com.

Chuck Zumbrun

unread,
Mar 5, 2022, 6:43:31 AM3/5/22
to Rose::DB::Object
It was the pg_enable_utf8 flag.  Reading the DBD::Pg documentation there's this gem:

"pg_enable_utf8 (integer)

DBD::Pg specific attribute. The behavior of DBD::Pg with regards to this flag has changed as of version 3.0.0. ..."

My build was going from DBD::pg 2.19.3 to 3.15.1  My old build didn't set pg_enable_utf8, setting it explicitly to 0 cleared up this issue for me.

Thanks for pointing me in the right direction!

Chuck
Reply all
Reply to author
Forward
0 new messages