Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Dancer2/Core/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ sub dispatch_path {
$path =~ s|^/+|/|;
# PSGI spec notes that '' should be considered '/'
$path = '/' if $path eq '';
return $path;
return Encode::decode('utf8', $path);
}

sub uri_for {
Expand Down
33 changes: 33 additions & 0 deletions t/utf8.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use utf8;
use strict;
use warnings;

use Test::More;
use Plack::Test;
use HTTP::Request::Common;
use Encode;

my $utf8 = 'ľščťžýáí';

{
package MyApp;

use Dancer2;
use utf8;

get '/ľščťžýáí' => sub {
return 'ľščťžýáí';
};
}

my $app = Dancer2->psgi_app;

test_psgi $app, sub {
my $cb = shift;

my $res = $cb->( GET '/ľščťžýáí' );
is $res->code, 200;
is Encode::decode('utf8', $res->content), 'ľščťžýáí';
};

done_testing();