Bugzilla – Attachment 17502 Details for
Bug 10068
Move from the utf8:: pragma methods to Encode::
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10068 - Replace the utf8 pragma at C4/Output.pm
Bug-10068---Replace-the-utf8-pragma-at-C4Outputpm.patch (text/plain), 1.13 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-04-17 13:52:13 UTC
(
hide
)
Description:
Bug 10068 - Replace the utf8 pragma at C4/Output.pm
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-04-17 13:52:13 UTC
Size:
1.13 KB
patch
obsolete
>From 5081adef44d3c46fdc5355b08aa6b400c2fe170f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Wed, 17 Apr 2013 10:09:24 -0300 >Subject: [PATCH] Bug 10068 - Replace the utf8 pragma at C4/Output.pm >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >utf8::encode($string) for Encode::encode('UTF-8',$string) > >Added Carp and error handling. > >Sponsored-by: Universidad Nacional de Córdoba >--- > C4/Output.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/C4/Output.pm b/C4/Output.pm >index 63acf14..da420f6 100644 >--- a/C4/Output.pm >+++ b/C4/Output.pm >@@ -34,6 +34,8 @@ use C4::Context; > use C4::Dates qw(format_date); > use C4::Budgets qw(GetCurrency); > use C4::Templates; >+use Carp; >+use Encode; > > use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); > >@@ -299,7 +301,9 @@ sub output_with_http_headers { > } > > $data =~ s/\&\;amp\; /\&\; /g; >- utf8::encode($data); >+ eval { $data = encode('UTF-8', $data, Encode::FB_CROAK); }; >+ if ( $@ ) { carp "Error encoding $data: $@" }; >+ > print $query->header($options), $data; > } > >-- >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 10068
:
17501
|
17502
|
17503
|
17504
|
17505
|
17506
|
17507