File: 04_utf8.t

package info (click to toggle)
libcgi-emulate-psgi-perl 0.23-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 148 kB
  • sloc: perl: 138; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;
use warnings;
use CGI;
use CGI::Emulate::PSGI;
use Test::More;

my $app = CGI::Emulate::PSGI->handler(
    sub {
        binmode STDOUT, ":utf8";
        print "Content-Type: text/html\r\n\r\n";
        print chr(4242);
    },
);

my $res = $app->({ REQUEST_METHOD => 'GET', 'psgi.input' => \*STDIN, 'psgi.errors' => \*STDERR });
is $res->[0], 200;
is_deeply $res->[2], [ "\xe1\x82\x92" ];

done_testing;