#!/usr/bin/perl -- use strict; use warnings; use HTTP::Server::PSGI; use Encode; my $app = sub { return [ 200, [ 'Content-Type' => 'text/html; charset=UTF-8', ], [ map { Encode::encode( 'UTF-8', $_ ) } ## turn to octets so Plack::Util doesn't have to qq{ PSGI is Perl }, Encode::decode( 'UTF-8', qq{

I \xe2\x99\xa5 Perl

} ## native "latin1" string ), ## unicode string qq{

I \x{2665} Perl}, ## unicode string '

' . ( chr(9829) x 10 ), ## unicode string ], ]; }; my $server = HTTP::Server::PSGI->new( host => "127.0.0.1", port => 9091, timeout => 120, ); $server->run($app); __END__ http://127.0.0.1:9091/