xenu has asked for the wisdom of the Perl Monks concerning the following question:
Hi! In the following code there's problem with URL escaping:
#!/usr/bin/perl use strict; use warnings; use utf8; use Pod::Simple::HTML my $pod_html_output; my $content = <<CONTENT; =head1 foobar L<<utf-8 letter (a with ogonek) which i can't paste here because perlm +onks doesn't support unicode>>> =cut CONTENT my $pod_html = Pod::Simple::HTML->new; $pod_html->output_string(\$pod_html_output); $pod_html->parse_string_document($content); print $pod_html_output;
'<utf-8 letter (a with ogonek) which i can't paste here because perlmonks doesn't support unicode>' is escaped to '%25105' instead of '%C4%85' I have tried overriding general_url_escape() but then i got even stranger results:
{ package Foobar::Pod::Simple::HTML; use base qw(Pod::Simple::HTML); use CGI::Util qw(escape); sub general_url_escape { my($self, $string) = @_; $string = escape($string); return $string; } }
In this case '<utf-8 letter (a with ogonek) which i can't paste here because perlmonks doesn't support unicode>' was escaped to '%105' (wtf?). Thanks in advance for help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with url escaping in Pod::Simple::HTML and UTF-8
by choroba (Cardinal) on Jun 26, 2011 at 11:11 UTC | |
|
Re: Problem with url escaping in Pod::Simple::HTML and UTF-8
by Anonymous Monk on Jun 26, 2011 at 11:41 UTC | |
|
Re: Problem with url escaping in Pod::Simple::HTML and UTF-8
by Anonymous Monk on Jun 26, 2011 at 12:34 UTC | |
|
Re: Problem with url escaping in Pod::Simple::HTML and UTF-8
by xenu (Novice) on Jun 26, 2011 at 14:56 UTC | |
by Corion (Patriarch) on Jun 26, 2011 at 15:02 UTC |