Comments (11)
I can test it... get back to you in a day or two.
from dbdpg.
@lkraav Feel free to open an issue and we can discuss some general topics before the details. Here we are at the wrong place to speak about SQL-Ledger.
from dbdpg.
I've tried to correct the UTF-8 handling in SQL-Ledger at https://github.com/Tekki/sql-ledger/tree/utf8_devel. Unfortunately nobody had time during the last 4 months to test my code.
from dbdpg.
The source of the problem is on the side of SQL-Ledger and I've proposed a solution in branch mentioned above (https://github.com/Tekki/sql-ledger/tree/utf8_devel). After half a year, I'm still waiting for someone to test it.
from dbdpg.
Okay, thanks, going to close this issue then. Good luck on the SQL-Ledger side!
from dbdpg.
Any thoughts @turnstep? How can we find out whether it's DBD-Pg or not?
EDIT I've inserted some debug statements like below
$query = qq|UPDATE gl SET
reference = |.$dbh->quote($form->{reference}).qq|,
description = |.$dbh->quote($form->{description}).qq|,
notes = |.$dbh->quote($form->{notes}).qq|,
transdate = '$form->{transdate}',
department_id = $department_id,
curr = '$form->{currency}',
exchangerate = $form->{exchangerate}
WHERE id = $form->{id}|;
$form->debug( "/tmp/sql-ledger.log", $query );
$dbh->do($query) || $form->dberror($query);
Checking /tmp/sql-ledger.log
it's clear that valid UTF-8 is getting to the app processing function. $dbh->do()
messes it up, so still looks like DBD-Pg is buggy.
from dbdpg.
I still don't understand - is DBD::Pg actually supposed to persist encoded strings in the database ("tööd" saves as "tööd") by design because that's how Perl stores it internally?
Nothing I'm doing at Perl level is making "tööd" save as "tööd" in the database :/
EDIT it seems to be about the app after all: https://github.com/Tekki/sql-ledger/blob/v3.2.05/SL/Form.pm#L160 does some custom escaping and probably breaking UTF-8.
from dbdpg.
There are two reasons for this problem: First, SQL-Ledger doesn't work with encodings, but treats everything as binary. Second, dbd-pg at some places converts binary to Unicode when it looks like UTF-8. The workaround for SQL-Ledger is still to install version 3.2.1, as I show in https://github.com/Tekki/ansible-sql-ledger.
from dbdpg.
@Tekki thanks for jumping in here, I was actually going to file an issue about this Unicode stuff at your repo next.
I think I might've reached a solid solution or at least a path to get to true UTF-8 handling through database, templates, etc, see http://www.sql-ledger.com/userforum/forum_entry.php?id=1220&page=0&category=0&order=last_answer for a quick overview of what's needed. I was planning to file the issue and present a list of commits for a proof of concept. Your fork seems to be the only active one left, so perhaps we could discuss further details there if you're interested.
from dbdpg.
I just came across this thread... just wanted to say that SQL-Ledger 3.2.5 and later works only with DBD-Pg version 3.2.1 and earlier, and only if you also set pg_enable_utf8 => 0. It seems that changes to later versions of DBD-Pg to fix UTF8 handling also broke things. If you search around, you’ll see the occasional comment about the breakage from Russians and others.
from dbdpg.
Any status on this? Or anything that needs fixing on the DBD::Pg end?
from dbdpg.
Related Issues (20)
- Value trimmed upon insert HOT 4
- Tests fail if root's shell is not a Bourne shell HOT 6
- Statement handle DESTROY slurps pending async queries
- Tests fail to start new DB: pg_ctl: unrecognized operation mode HOT 4
- DBD::Pg 3.16.0 tests fail HOT 11
- Dying with non-ASCII utf8 DB message, with use warnings FATAL => 'all'; leads to "Wide character in subroutine entry" error message with DB-message omitted HOT 6
- Old postgresql client has trouble with new DBD::Pg versions due to bug in old postgresql client libraries HOT 3
- Error building DBD::Pg on macOS Monterey HOT 5
- META.yaml should be META.yml HOT 4
- DBD::Pg builds are failing to produce MYMETA.json files HOT 3
- Simple select of jsonb field returning empty result when field is NULL HOT 6
- Change in result type of EXTRACT() with Pg14 upwards not handled HOT 1
- MERGE INTO statement handles not returning total count of rows affected HOT 2
- Can't load Pg.so on Ubuntu 20.04 and Postgres 8.3.5 - tries to use lo_import_with_oid HOT 1
- Test fails on my system for DBD-Pg-3.15.1-1 HOT 2
- Error in tests if localization is enabled and install by root HOT 1
- Compile error 'initdb' not recognized for ver 3.15.1 HOT 10
- Set utf8 flag in pg_db_error_field HOT 2
- Hanging execution of queries like "COPY TO STDIN" in asynchronous mode. HOT 2
- t/03smethod.t fails with DBI v1.641 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbdpg.