Bugzilla – Attachment 21632 Details for
Bug 6554
Resolve encoding problems with corrected UTF8 handling in templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug 6554: UTF8 double encoding fixes. Commits squashed into one.
UTF8-double-encoding-fixes-Commits-squashed-into-o.patch (text/plain), 4.43 KB, created by
Srdjan Jankovic
on 2013-09-30 05:23:04 UTC
(
hide
)
Description:
bug 6554: UTF8 double encoding fixes. Commits squashed into one.
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2013-09-30 05:23:04 UTC
Size:
4.43 KB
patch
obsolete
>From e9e13af491339861516a5cd39abd0ad090529e4c Mon Sep 17 00:00:00 2001 >From: Ketan Kulkarni <ketan@carvingit.com> >Date: Tue, 24 Sep 2013 15:53:55 +0530 >Subject: [PATCH] UTF8 double encoding fixes. Commits squashed into one. > >double utf8 encoding fix .. second try > >minor formatting updates > >enhancement to the previous patch related to utf8 double encoding > >added ENCODING=>utf8 to new-> > >added space which is there in master > >added utf8::decode for ms_query > >replaced tabs with spaces > >replaced tabs with spaces > >removed extra space > >Signed-off-by: Srdjan <srdjan@catalyst.net.nz> > >http://bugs.koha-community.org/show_bug.cgi?id=6554 >--- > C4/ItemType.pm | 4 ++-- > C4/Search.pm | 2 ++ > C4/Templates.pm | 7 ++++--- > members/member.pl | 3 +++ > opac/opac-search.pl | 1 + > 5 files changed, 12 insertions(+), 5 deletions(-) > >diff --git a/C4/ItemType.pm b/C4/ItemType.pm >index ad253a7..4aa23d4 100644 >--- a/C4/ItemType.pm >+++ b/C4/ItemType.pm >@@ -81,7 +81,7 @@ sub all { > for ( @{$dbh->selectall_arrayref( > "SELECT * FROM itemtypes ORDER BY description", { Slice => {} })} ) > { >- utf8::encode($_->{description}); >+ utf8::upgrade($_->{description}); > push @itypes, $class->new($_); > } > return @itypes; >@@ -105,7 +105,7 @@ sub get { > "SELECT * FROM itemtypes WHERE itemtype = ?", undef, $itemtype > ); > if ( $data->{description} ) { >- utf8::encode($data->{description}); >+ utf8::upgrade($data->{description}); > } > return $class->new($data); > } >diff --git a/C4/Search.pm b/C4/Search.pm >index 0453b91..1180746 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -574,6 +574,7 @@ sub getRecords { > { > > # Sanitize the link value : parenthesis, question and exclamation mark will cause errors with CCL >+ utf8::decode($one_facet); > my $facet_link_value = $one_facet; > $facet_link_value =~ s/[()!?¡¿Ø]/ /g; > >@@ -1606,6 +1607,7 @@ sub buildQuery { > warn "LIMIT DESC:" . $limit_desc; > warn "---------\nLeave buildQuery\n---------"; > } >+ utf8::decode($query_desc); > return ( > undef, $query, $simple_query, $query_cgi, > $query_desc, $limit, $limit_cgi, $limit_desc, >diff --git a/C4/Templates.pm b/C4/Templates.pm >index 21604fc..51a9df5 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -62,6 +62,7 @@ sub new { > my $template = Template->new( > { EVAL_PERL => 1, > ABSOLUTE => 1, >+ ENCODING => 'utf8', > PLUGIN_BASE => 'Koha::Template::Plugin', > COMPILE_EXT => C4::Context->config('template_cache_dir')?'.ttc':'', > COMPILE_DIR => C4::Context->config('template_cache_dir')?C4::Context->config('template_cache_dir'):'',, >@@ -124,7 +125,7 @@ sub output { > utf8_hashref($vars->{$k}); > } > else { >- utf8::encode($vars->{$k}) if utf8::is_utf8($vars->{$k}); >+ utf8::upgrade($vars->{$k}) if utf8::is_utf8($vars->{$k}); > } > } > my $data; >@@ -145,7 +146,7 @@ sub utf8_arrayref { > utf8_hashref($element); > next; > } >- utf8::encode($element) if utf8::is_utf8($element); >+ utf8::upgrade($element) if utf8::is_utf8($element); > } > } > >@@ -160,7 +161,7 @@ sub utf8_hashref { > utf8_hashref($hashref->{$key}); > next; > } >- utf8::encode($hashref->{$key}) if utf8::is_utf8($hashref->{$key}); >+ utf8::upgrade($hashref->{$key}) if utf8::is_utf8($hashref->{$key}); > } > } > >diff --git a/members/member.pl b/members/member.pl >index 78b762f..a30b01b 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -49,6 +49,9 @@ my ($template, $loggedinuser, $cookie) > my $theme = $input->param('theme') || "default"; > > my $patron = $input->Vars; >+my $tmp_member = $patron->{member}; >+utf8::decode($tmp_member); >+$patron->{member} = $tmp_member; > foreach (keys %$patron){ > delete $$patron{$_} unless($$patron{$_}); > } >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 2854da6..664285f 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -395,6 +395,7 @@ $template->{VARS}->{querystring} = join(' ', @operands); > if ($operands[0] && !$operands[1]) { > my $ms_query = $operands[0]; > $ms_query =~ s/ #\S+//; >+ utf8::decode($ms_query); > $template->param(ms_value => $ms_query); > } > >-- >1.8.1.2
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 6554
:
4558
|
4560
|
4561
|
4562
|
4563
|
4564
|
5962
|
6041
|
6065
|
6070
|
6071
|
6072
|
6073
|
6076
|
6077
|
6078
|
6079
|
6080
|
6083
|
6084
|
6085
|
6108
|
10118
|
16780
|
16797
|
16857
|
16905
|
16929
|
16930
|
16931
|
16932
|
16960
|
16961
|
16962
|
16963
|
16964
|
16966
|
16968
|
16969
|
16984
|
16985
|
16986
|
16987
|
16988
|
16989
|
17179
|
17186
|
17187
|
17327
|
17328
|
18746
|
18747
|
18749
|
18750
|
21318
|
21399
|
21478
|
21488
|
21506
|
21509
|
21581
|
21629
|
21631
|
21632
|
21682
|
21937
|
21955
|
21978
|
21980
|
21981
|
23107
|
23140