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.
This commit is contained in:
Alex Schroeder
2012-08-13 16:00:47 +02:00
parent dd7e158881
commit 84fabbff2f
2 changed files with 6 additions and 2 deletions

View File

@@ -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("Русский", "друзья"),
"друзья");

View File

@@ -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);