Bug 14584: Encoding broken with system preferences
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 18 Aug 2015 17:40:31 +0000 (18:40 +0100)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Wed, 2 Sep 2015 13:03:57 +0000 (10:03 -0300)
The pref are double encoded.

From bug 12411:
"This will fix the encoding issues existing in 3.14 and 3.16.
The issue still appear in master but is fixed by bug 11944."

They should not have been pushed together.

Test plan:
1) You need an accentuated language installed.
2) Go to NoLoginInstructions pref, and add some accentuated message like
"Hélo médames é mècieüx"
3) refresh opac home page, message should be gibberish
4) apply patch.  Message should be ok now.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Works as expected.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Koha/Template/Plugin/Koha.pm

index ecb6266..86f9e77 100644 (file)
@@ -18,7 +18,6 @@ package Koha::Template::Plugin::Koha;
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
-use Encode qw( encode );
 
 use base qw( Template::Plugin );
 
@@ -43,7 +42,7 @@ is necessary.
 
 sub Preference {
     my ( $self, $pref ) = @_;
-    return encode('UTF-8', C4::Context->preference( $pref ) );
+    return C4::Context->preference( $pref );
 }
 
 sub Version {