Discussion:
PSGI and utf8 encoding
(too old to reply)
DryDuck
2015-08-29 21:20:18 UTC
Permalink
Hi

I have run into a strange bug.

When I run my Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2" all utf8 characters are double encoded.
On the other hand if the app is run using plackup then the output is
correct, except for the BOM issue explained below.

The template file is utf8 encoded, without a BOM, because if it has a BOM
then the BOM is included in the output.
Also when the template has a BOM any commands in the first line of the file
are ignored.

I'm using:

Ubuntu 14.04.3 LTS
Plack 1.0037 (installed from CPAN)
Apache/2.4.7
Perl v5.18.2
mod_perl 2.000008
Mojolicious 6.17 (installed from CPAN)

I am at a loss as to both why the utf8 characters are getting double
encoded and why the BOM is included in the output.


/DryDuck
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Dan Book
2015-08-29 22:53:12 UTC
Permalink
UTF-8 encoded files should not have a BOM, that is normal. I don't know
about mod_perl and plack's handling of encoding, but could you use a proxy
to Hypnotoad instead of going through mod_perl and PSGI? It would be a
cleaner solution.
Post by DryDuck
Hi
I have run into a strange bug.
When I run my Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2" all utf8 characters are double encoded.
On the other hand if the app is run using plackup then the output is
correct, except for the BOM issue explained below.
The template file is utf8 encoded, without a BOM, because if it has a BOM
then the BOM is included in the output.
Also when the template has a BOM any commands in the first line of the
file are ignored.
Ubuntu 14.04.3 LTS
Plack 1.0037 (installed from CPAN)
Apache/2.4.7
Perl v5.18.2
mod_perl 2.000008
Mojolicious 6.17 (installed from CPAN)
I am at a loss as to both why the utf8 characters are getting double
encoded and why the BOM is included in the output.
/DryDuck
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
DryDuck
2015-08-30 07:57:27 UTC
Permalink
The BOM is allowed in UTF-8 and must per the unicode standard be stripped
before any further processing of the text occurs. So I would say that it is
a bug in Mojolicious that it doesn't strip the BOM.

luckily I found the error: It appears that
Mojolicious::Plugin::ConsoleLogger is to blame for my troubles, because if
I don't use it the output is correct, except for the BOM issue - which is
manageable.


/DryDuck
Post by Dan Book
UTF-8 encoded files should not have a BOM, that is normal. I don't know
about mod_perl and plack's handling of encoding, but could you use a proxy
to Hypnotoad instead of going through mod_perl and PSGI? It would be a
cleaner solution.
Post by DryDuck
Hi
I have run into a strange bug.
When I run my Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2" all utf8 characters are double encoded.
On the other hand if the app is run using plackup then the output is
correct, except for the BOM issue explained below.
The template file is utf8 encoded, without a BOM, because if it has a BOM
then the BOM is included in the output.
Also when the template has a BOM any commands in the first line of the
file are ignored.
Ubuntu 14.04.3 LTS
Plack 1.0037 (installed from CPAN)
Apache/2.4.7
Perl v5.18.2
mod_perl 2.000008
Mojolicious 6.17 (installed from CPAN)
I am at a loss as to both why the utf8 characters are getting double
encoded and why the BOM is included in the output.
/DryDuck
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
sri
2015-08-30 09:18:54 UTC
Permalink
So I would say that it is a bug in Mojolicious that it doesn't strip the
BOM.
This statement does not make any sense to me i'm afraid, where exactly in
Mojolicious do you think there is a bug?

--
sebastian
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
DryDuck
2015-08-30 12:14:09 UTC
Permalink
The unicode standard stats that BOMs should be stripped before any
processing of a unicode string is performed.

Quote
from http://www.unicode.org/versions/Unicode8.0.0/UnicodeStandard-8.0.pdf
page 834

Systems that use the byte order mark must recognize when an initial U+FEFF
signals the
byte order. In those cases, it is not part of the textual content and
should be removed before
processing, because otherwise it may be mistaken for a legitimate zero
width no-break space.
That is why I think that there is a bug in Mojolicious. It does not strip
the BOM from a template before it is processed.


/DryDuck
So I would say that it is a bug in Mojolicious that it doesn't strip the
BOM.
This statement does not make any sense to me i'm afraid, where exactly in
Mojolicious do you think there is a bug?
--
sebastian
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
sri
2015-08-30 12:35:15 UTC
Permalink
Post by DryDuck
The unicode standard stats that BOMs should be stripped before any
processing of a unicode string is performed.
Quote from
http://www.unicode.org/versions/Unicode8.0.0/UnicodeStandard-8.0.pdf page
834
Systems that use the byte order mark must recognize when an initial U+FEFF
signals the
byte order. In those cases, it is not part of the textual content and
should be removed before
processing, because otherwise it may be mistaken for a legitimate zero
width no-break space.
That is why I think that there is a bug in Mojolicious. It does not strip
the BOM from a template before it is processed.
This cannot be a bug in Mojolicious. Like almost everything else in the
Perl world, we do not deal with Unicode directly, and rely completely on
the Encode module.

--
sebastian
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
DryDuck
2015-08-30 18:09:14 UTC
Permalink
You are unfortunately right. It is the rather silly behavior of
Encode::Unicode that is to blame.
When Encode::Unicode encounters a BOM in a UTF-8 encoded file it leaves it
alone, all other BOM types are removed, talk about inconsistency

Unfortunately I think that it will be very hard to get Encode::Unicode
changed so that it also removes the BOM when working on UTF-8 encoded files.
Which leaves it up to Mojolicious to do the right thing, that is to strip
the UTF-8 BOM from the templates when loading them.


/DryDuck
Post by DryDuck
The unicode standard stats that BOMs should be stripped before any
Post by DryDuck
processing of a unicode string is performed.
Quote from
http://www.unicode.org/versions/Unicode8.0.0/UnicodeStandard-8.0.pdf
page 834
Systems that use the byte order mark must recognize when an initial
U+FEFF signals the
byte order. In those cases, it is not part of the textual content and
should be removed before
processing, because otherwise it may be mistaken for a legitimate zero
width no-break space.
That is why I think that there is a bug in Mojolicious. It does not strip
the BOM from a template before it is processed.
This cannot be a bug in Mojolicious. Like almost everything else in the
Perl world, we do not deal with Unicode directly, and rely completely on
the Encode module.
--
sebastian
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
LarsSoem
2015-12-29 14:12:13 UTC
Permalink
I have the same problem with double encoded utf8 characters in url's when
deplaying a Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2". No problem with morbo or plackup.
I solve the problem with the hack shown below, but I would really like to
know how to solve the problem the "right" way. I am running Debian stable.
Any ideas?

/LarsSoem

$app->hook(before_dispatch => sub {
my $path = shift->req->url->path;
my $str = join('/', map {
uri_unescape($_);
utf8::encode($_) unless utf8::is_utf8($_);
uri_escape($_)
} @{$path->parts});
$str = "/$str" if $path->leading_slash;
$str .= '/' if $path->trailing_slash;
$path->parse($str);
});
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Helmut Wollmersdorfer
2016-01-01 23:01:41 UTC
Permalink
Post by LarsSoem
I have the same problem with double encoded utf8 characters in url's when
deplaying a Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2". No problem with morbo or plackup.
Please post your Apache-conf.

Never had this problem on Debian.

Here an example:

<VirtualHost *:80>
DocumentRoot /var/www/cpancover.wollmersdorfer.org

ServerName cpancover.wollmersdorfer.org

PerlOptions +Parent

<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_HOME} = '/var/www/cpancover.wollmersdorfer.org';
$ENV{MOJO_MODE} = 'deployment';
$ENV{MOJO_RELOAD} = 1;
$ENV{MOJO_LOG_LEVEL} = 'debug';
use lib ( "/var/www/cpancover.wollmersdorfer.org/lib");
</Perl>

<Location />
Order allow,deny
Allow from all
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
PerlSetVar psgi_app
/var/www/cpancover.wollmersdorfer.org/script/wcpancover
</Location>

</VirtualHost>
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
LarsSoem
2016-01-03 12:41:13 UTC
Permalink
I can reproduce the problem with an apache config as simple as

<VirtualHost *:80>
DocumentRoot /usr/share/lh-webserver/www
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_MODE} = 'deployment';
</Perl>
<Location /test>
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app
/home/lh/work/mojolicious/utf8url/script/test
</Location>
</VirtualHost>


I run Apache 2.4.10. Btw, observe that in

http://foo/ÊÞå

matched by

$r->get('/foo/#arg')->to('foo#arg');

the 'arg' become double encoded whereas in

http://foo?arg=ÊÞå

the 'arg' is ok.

/LarsSoem

On Saturday, January 2, 2016 at 12:01:41 AM UTC+1, Helmut Wollmersdorfer
Post by Helmut Wollmersdorfer
Post by LarsSoem
I have the same problem with double encoded utf8 characters in url's when
deplaying a Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2". No problem with morbo or plackup.
Please post your Apache-conf.
Never had this problem on Debian.
<VirtualHost *:80>
DocumentRoot /var/www/cpancover.wollmersdorfer.org
ServerName cpancover.wollmersdorfer.org
PerlOptions +Parent
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_HOME} = '/var/www/cpancover.wollmersdorfer.org';
$ENV{MOJO_MODE} = 'deployment';
$ENV{MOJO_RELOAD} = 1;
$ENV{MOJO_LOG_LEVEL} = 'debug';
use lib ( "/var/www/cpancover.wollmersdorfer.org/lib");
</Perl>
<Location />
Order allow,deny
Allow from all
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
PerlSetVar psgi_app /var/www/
cpancover.wollmersdorfer.org/script/wcpancover
</Location>
</VirtualHost>
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Helmut Wollmersdorfer
2016-01-03 18:56:51 UTC
Permalink
Hi,

I cannot reproduce it.

# mojo version
CORE
Perl (v5.20.2, linux)
Mojolicious (6.17, Clinking Beer Mugs)

# dpkg -l apache2 | grep apache

ii apache2 2.4.10-10+deb8u3 amd64 Apache HTTP Server


$routes->get('/diag/#parm')->to('diag#show');

sub show {
my $self = shift;

# Render $page
$self->render_not_found
unless $self->render();
}


% layout 'default';
% title 'Diag for parm';

<h1>Diag for parm <%= $parm %></h1>

<pre>
<%= dumper $parm %>

<%= dumper \%ENV %>
</pre>


http://cpancover.wollmersdorfer.org/diag/ÊÞå

Rendered:

Diag for parm ÊÞå

Dumper of $parm:

"\x{e6}\x{f8}\x{e5}"


OK, is character mode.

From Dumper of %ENV:

"PATH_INFO" => "/\303\246\303\270\303\245",

"REQUEST_URI" => "/diag/%C3%A6%C3%B8%C3%A5",


OK, both confirming Plack/PSGI.

So, something must be different.

Browser? Latest Chrome, FireFox and Safari work for me.

Try http://cpancover.wollmersdorfer.org/diag/something, it's online.

HTH

Helmut Wollmersdorfer
Post by LarsSoem
I can reproduce the problem with an apache config as simple as
<VirtualHost *:80>
DocumentRoot /usr/share/lh-webserver/www
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_MODE} = 'deployment';
</Perl>
<Location /test>
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app
/home/lh/work/mojolicious/utf8url/script/test
</Location>
</VirtualHost>
I run Apache 2.4.10. Btw, observe that in
http://foo/ÊÞå
matched by
$r->get('/foo/#arg')->to('foo#arg');
the 'arg' become double encoded whereas in
http://foo?arg=ÊÞå
the 'arg' is ok.
/LarsSoem
On Saturday, January 2, 2016 at 12:01:41 AM UTC+1, Helmut Wollmersdorfer
Post by Helmut Wollmersdorfer
Post by LarsSoem
I have the same problem with double encoded utf8 characters in url's
when deplaying a Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2". No problem with morbo or plackup.
Please post your Apache-conf.
Never had this problem on Debian.
<VirtualHost *:80>
DocumentRoot /var/www/cpancover.wollmersdorfer.org
ServerName cpancover.wollmersdorfer.org
PerlOptions +Parent
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_HOME} = '/var/www/cpancover.wollmersdorfer.org';
$ENV{MOJO_MODE} = 'deployment';
$ENV{MOJO_RELOAD} = 1;
$ENV{MOJO_LOG_LEVEL} = 'debug';
use lib ( "/var/www/cpancover.wollmersdorfer.org/lib");
</Perl>
<Location />
Order allow,deny
Allow from all
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
PerlSetVar psgi_app /var/www/
cpancover.wollmersdorfer.org/script/wcpancover
</Location>
</VirtualHost>
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
LarsSoem
2016-01-03 21:14:27 UTC
Permalink
Hi

Strange. I have

# mojo version
CORE
Perl (v5.20.2, linux)
Mojolicious (5.54, Tiger Face)

# dpkg -l apache2 | grep apache
ii apache2 2.4.10-10+deb8u3 amd64 Apache HTTP Server

# cat /etc/default/locale
# File generated by update-locale
LANG=en_DK.UTF-8
LANGUAGE="en_US:en"
LC_TIME=en_DK.UTF-8

Mojolicious version 5.54 is the one in Debian stable.
I have tried to upgrade to 6.17, but it seems to change nothing.

/LarsSoem
Post by Helmut Wollmersdorfer
Hi,
I cannot reproduce it.
# mojo version
CORE
Perl (v5.20.2, linux)
Mojolicious (6.17, Clinking Beer Mugs)
# dpkg -l apache2 | grep apache
ii apache2 2.4.10-10+deb8u3 amd64 Apache HTTP Server
$routes->get('/diag/#parm')->to('diag#show');
sub show {
my $self = shift;
# Render $page
$self->render_not_found
unless $self->render();
}
% layout 'default';
% title 'Diag for parm';
<h1>Diag for parm <%= $parm %></h1>
<pre>
<%= dumper $parm %>
<%= dumper \%ENV %>
</pre>
http://cpancover.wollmersdorfer.org/diag/ÊÞå
<http://cpancover.wollmersdorfer.org/diag/%C3%A6%C3%B8%C3%A5>
Diag for parm ÊÞå
"\x{e6}\x{f8}\x{e5}"
OK, is character mode.
"PATH_INFO" => "/\303\246\303\270\303\245",
"REQUEST_URI" => "/diag/%C3%A6%C3%B8%C3%A5",
OK, both confirming Plack/PSGI.
So, something must be different.
Browser? Latest Chrome, FireFox and Safari work for me.
Try http://cpancover.wollmersdorfer.org/diag/something, it's online.
HTH
Helmut Wollmersdorfer
Post by LarsSoem
I can reproduce the problem with an apache config as simple as
<VirtualHost *:80>
DocumentRoot /usr/share/lh-webserver/www
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_MODE} = 'deployment';
</Perl>
<Location /test>
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app
/home/lh/work/mojolicious/utf8url/script/test
</Location>
</VirtualHost>
I run Apache 2.4.10. Btw, observe that in
http://foo/ÊÞå
matched by
$r->get('/foo/#arg')->to('foo#arg');
the 'arg' become double encoded whereas in
http://foo?arg=ÊÞå
the 'arg' is ok.
/LarsSoem
On Saturday, January 2, 2016 at 12:01:41 AM UTC+1, Helmut Wollmersdorfer
Post by Helmut Wollmersdorfer
Post by LarsSoem
I have the same problem with double encoded utf8 characters in url's
when deplaying a Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2". No problem with morbo or plackup.
Please post your Apache-conf.
Never had this problem on Debian.
<VirtualHost *:80>
DocumentRoot /var/www/cpancover.wollmersdorfer.org
ServerName cpancover.wollmersdorfer.org
PerlOptions +Parent
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_HOME} = '/var/www/cpancover.wollmersdorfer.org';
$ENV{MOJO_MODE} = 'deployment';
$ENV{MOJO_RELOAD} = 1;
$ENV{MOJO_LOG_LEVEL} = 'debug';
use lib ( "/var/www/cpancover.wollmersdorfer.org/lib");
</Perl>
<Location />
Order allow,deny
Allow from all
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
PerlSetVar psgi_app /var/www/
cpancover.wollmersdorfer.org/script/wcpancover
</Location>
</VirtualHost>
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Helmut Wollmersdorfer
2016-01-06 17:09:45 UTC
Permalink
Post by LarsSoem
Hi
Strange. I have
# mojo version
CORE
Perl (v5.20.2, linux)
Mojolicious (5.54, Tiger Face)
# dpkg -l apache2 | grep apache
ii apache2 2.4.10-10+deb8u3 amd64 Apache HTTP Server
# cat /etc/default/locale
# File generated by update-locale
LANG=en_DK.UTF-8
LANGUAGE="en_US:en"
LC_TIME=en_DK.UTF-8
Here I have:

***@w4:/home/helmut# cat /etc/default/locale

# File generated by update-locale

LANG="en_US.UTF-8"


I always install all locales (because some apps need them), but only
configure them per user:


***@w4:~$ locale

LANG=en_US.UTF-8

LANGUAGE=

LC_CTYPE="en_US.UTF-8"

LC_NUMERIC="en_US.UTF-8"

LC_TIME="en_US.UTF-8"

LC_COLLATE="en_US.UTF-8"

LC_MONETARY="en_US.UTF-8"

LC_MESSAGES="en_US.UTF-8"

LC_PAPER="en_US.UTF-8"

LC_NAME="en_US.UTF-8"

LC_ADDRESS="en_US.UTF-8"

LC_TELEPHONE="en_US.UTF-8"

LC_MEASUREMENT="en_US.UTF-8"

LC_IDENTIFICATION="en_US.UTF-8"

LC_ALL=
Post by LarsSoem
Mojolicious version 5.54 is the one in Debian stable.
I have tried to upgrade to 6.17, but it seems to change nothing.
You can install Mojolicious via CPAN (I did). Or install it directly per
webspace and set the lib to it.

But I never watched this behaviour beginning from version 4.x to 6.x. I
have 8 Mojo-apps still in production on the last three Debian versions.

Do you maybe 'use utf8;' somewhere in the source and apply a regex or join
a literal string with non-ASCI characters?

Try to reproduce with a minimal app like my example.

Helmut Wollmersdorfer
Post by LarsSoem
/LarsSoem
Post by Helmut Wollmersdorfer
Hi,
I cannot reproduce it.
# mojo version
CORE
Perl (v5.20.2, linux)
Mojolicious (6.17, Clinking Beer Mugs)
# dpkg -l apache2 | grep apache
ii apache2 2.4.10-10+deb8u3 amd64 Apache HTTP Server
$routes->get('/diag/#parm')->to('diag#show');
sub show {
my $self = shift;
# Render $page
$self->render_not_found
unless $self->render();
}
% layout 'default';
% title 'Diag for parm';
<h1>Diag for parm <%= $parm %></h1>
<pre>
<%= dumper $parm %>
<%= dumper \%ENV %>
</pre>
http://cpancover.wollmersdorfer.org/diag/ÊÞå
<http://cpancover.wollmersdorfer.org/diag/%C3%A6%C3%B8%C3%A5>
Diag for parm ÊÞå
"\x{e6}\x{f8}\x{e5}"
OK, is character mode.
"PATH_INFO" => "/\303\246\303\270\303\245",
"REQUEST_URI" => "/diag/%C3%A6%C3%B8%C3%A5",
OK, both confirming Plack/PSGI.
So, something must be different.
Browser? Latest Chrome, FireFox and Safari work for me.
Try http://cpancover.wollmersdorfer.org/diag/something, it's online.
HTH
Helmut Wollmersdorfer
Post by LarsSoem
I can reproduce the problem with an apache config as simple as
<VirtualHost *:80>
DocumentRoot /usr/share/lh-webserver/www
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_MODE} = 'deployment';
</Perl>
<Location /test>
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app
/home/lh/work/mojolicious/utf8url/script/test
</Location>
</VirtualHost>
I run Apache 2.4.10. Btw, observe that in
http://foo/ÊÞå
matched by
$r->get('/foo/#arg')->to('foo#arg');
the 'arg' become double encoded whereas in
http://foo?arg=ÊÞå
the 'arg' is ok.
/LarsSoem
On Saturday, January 2, 2016 at 12:01:41 AM UTC+1, Helmut Wollmersdorfer
Post by Helmut Wollmersdorfer
Post by LarsSoem
I have the same problem with double encoded utf8 characters in url's
when deplaying a Mojolicious app under Apache using "PerlResponseHandler
Plack::Handler::Apache2". No problem with morbo or plackup.
Please post your Apache-conf.
Never had this problem on Debian.
<VirtualHost *:80>
DocumentRoot /var/www/cpancover.wollmersdorfer.org
ServerName cpancover.wollmersdorfer.org
PerlOptions +Parent
<Perl>
$ENV{PLACK_ENV} = 'production';
$ENV{MOJO_HOME} = '/var/www/cpancover.wollmersdorfer.org';
$ENV{MOJO_MODE} = 'deployment';
$ENV{MOJO_RELOAD} = 1;
$ENV{MOJO_LOG_LEVEL} = 'debug';
use lib ( "/var/www/cpancover.wollmersdorfer.org/lib");
</Perl>
<Location />
Order allow,deny
Allow from all
SetHandler perl-script
PerlHandler Plack::Handler::Apache2
PerlSetVar psgi_app /var/www/
cpancover.wollmersdorfer.org/script/wcpancover
</Location>
</VirtualHost>
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Loading...