Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 16598
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: ananiev [...] thegdb.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: Fine tune unicode support
Currently DBD::SQLite sets the utf8 flag to true for every string when $dbh->{'unicode'} = 1. This slows down Perl on ASCII-only strings. In the attached file I've added a function "sqlite3_high_bit_set" (which is taken from DBD::Pg) which checks whether the string is ascii or utf8. And if $dbh->{unicode} = 1 and the string contains high-bit chars, only then the utf8 flag is set to true. I hope this will make it in the next version of DBD::SQLite. P.S. the attached file is taken from DBD-SQLite-1.11 package

Message body is not shown because it is too large.

From: dom [...] happygiraffe.net
On Mon Dec 19 04:34:49 2005, guest wrote: Show quoted text
> Currently DBD::SQLite sets the utf8 flag to true for every string when > $dbh->{'unicode'} = 1. This slows down Perl on ASCII-only strings. > In the attached file I've added a function "sqlite3_high_bit_set" > (which is taken from DBD::Pg) which checks whether the string is ascii > or utf8. > And if $dbh->{unicode} = 1 and the string contains high-bit chars, > only then the utf8 flag is set to true. > I hope this will make it in the next version of DBD::SQLite. > P.S. the attached file is taken from DBD-SQLite-1.11 package
Just to point out that there's a better way these days which I didn't know about when I did the support for DBD::Pg. Instead of calling SvUTF8_on(), call sv_utf8_decode() instead. That does the same thing, but it's part of Perl, so doesn't have to be maintained. :-) Naturally, it needs to be protected by "#ifdef sv_utf8_decode". -Dom
Marking resolved. At least until Unicode in DBI is properly resolved. Currently we have to turn utf-8 off on every result column otherwise weird things happen.