Bugzilla – Attachment 26623 Details for
Bug 11906
Bad display of utf-8 chars in Patron lists (Datatable)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11906: ensure that Koha::Database uses UTF8 mode when connecting to databases
Bug-11906-ensure-that-KohaDatabase-uses-UTF8-mode-.patch (text/plain), 2.06 KB, created by
Jonathan Druart
on 2014-03-27 09:16:57 UTC
(
hide
)
Description:
Bug 11906: ensure that Koha::Database uses UTF8 mode when connecting to databases
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-27 09:16:57 UTC
Size:
2.06 KB
patch
obsolete
>From f30b322e0701f22c777d80f0f3c8af1eb86e8d84 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Wed, 26 Mar 2014 20:38:32 +0000 >Subject: [PATCH] Bug 11906: ensure that Koha::Database uses UTF8 mode when > connecting to databases > >This patch fixes an issue whereby the DBIx::Class schema objects >were not connecting to the underlying database in UTF8 mode. This >most visibility manifested as patron list pages not displaying >diacritics correctly. > >To test: > >[1] Create a patron list, and make sure that it contains at least > one patron whose name or patron category description contains > a non-ASCII character. >[2] View the list contents; the diacritics should appear mangled. >[3] Apply the patch. >[4] View the patron list again. This time, the diacritics should > be displayed correctly. Note that Apache will also log > "list.pl: Wide character in print ...", but this is the lesser > of two evils. >[5] Verify that prove -v t/db_dependent/Koha_Database.t passes. >[6] (extra credit) Verify that t/db_dependent/Koha_Database.t > passes when connect to a PostgreSQL database. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > Koha/Database.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/Database.pm b/Koha/Database.pm >index 12758bf..b259ca0 100644 >--- a/Koha/Database.pm >+++ b/Koha/Database.pm >@@ -53,9 +53,13 @@ sub _new_schema { > my $db_port = $context->config("port") || ''; > my $db_user = $context->config("user"); > my $db_passwd = $context->config("pass"); >+ >+ my $db_opts = ($db_driver eq 'mysql') ? { mysql_enable_utf8 => 1 } : >+ ($db_driver eq 'Pg') ? { pg_enable_utf8 => 1 } : >+ { }; > my $schema = Koha::Schema->connect( > "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port", >- $db_user, $db_passwd ); >+ $db_user, $db_passwd, $db_opts ); > return $schema; > } > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11906
:
25916
|
26614
|
26615
|
26616
|
26617
|
26622
| 26623 |
26624