From 84fabbff2f88512dc1675cf18fb54d58db44da65 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Mon, 13 Aug 2012 16:00:47 +0200 Subject: [PATCH] Add another test regarding UTF-8 pagenames. Use binmode(":pop:raw") because this appears to be necessary for Windows users -- Ingo Belka was using ActivePerl versions 5.10.1 and 5.14.2 to test it. --- t/encoding.t | 6 +++++- wiki.pl | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/t/encoding.t b/t/encoding.t index e0bebabf..6dd4812f 100644 --- a/t/encoding.t +++ b/t/encoding.t @@ -14,7 +14,7 @@ require 't/test.pl'; package OddMuse; -use Test::More tests => 40; +use Test::More tests => 41; use utf8; # tests contain UTF-8 characters and it matters clear_pages(); @@ -110,3 +110,7 @@ test_page(get_page("action=browse id=All cache=0"), "Русский"); # testing search test_page(get_page('search=Русский raw=1'), qw(Russian)); + +# testing page editing +test_page(update_page("Русский", "друзья"), + "друзья"); diff --git a/wiki.pl b/wiki.pl index af23250c..7239dd9c 100755 --- a/wiki.pl +++ b/wiki.pl @@ -3131,7 +3131,7 @@ sub DoDownload { if @UploadTypes and not $allowed{$type}; print GetHttpHeader($type, $ts, undef, $encoding); require MIME::Base64; - binmode(STDOUT, "raw"); + binmode(STDOUT, ":pop:raw"); # need to pop utf8 for Windows users!? print MIME::Base64::decode($data); } else { print GetHttpHeader('text/plain', $ts);