Subject: | Wide Character Support |
Date: | Thu, 27 Sep 2007 11:16:59 +0200 |
To: | bug-Text-Markdown [...] rt.cpan.org |
From: | Mark Lawrence <nomad [...] null.net> |
Hi,
I didn't get much of a response from the owner of the Markdown mailing
list, but I would appreciate it if at least the next CPAN version could
handle the full range of UTF-8 as input.
Regards,
Mark.
----- Forwarded message from Mark Lawrence <nomad@null.net> -----
Show quoted text
> Date: Thu, 20 Sep 2007 09:54:10 +0200
> From: Mark Lawrence <nomad@null.net>
> To: markdown-discuss@six.pairlist.net
> Subject: Wide Character Support
>
> Hi,
>
> I recently ran some UTF-8 characters through Markdown and ran into an
> issue where calls to md5_hex were croaking with a wide character
> message.
>
> The attached patch fixes that up, so that languages like Arabic work ok.
>
> Cheers,
> Mark.
> --
> Mark Lawrence
>
>
> --- Markdown.pl.orig 2007-09-20 09:48:10.000000000 +0200
> +++ Markdown.pl 2007-09-20 09:49:01.000000000 +0200
> @@ -14,6 +14,7 @@
> use warnings;
>
> use Digest::MD5 qw(md5_hex);
> +use Encode qw(encode_utf8);
> use vars qw($VERSION);
> $VERSION = '1.0.1';
> # Tue 14 Dec 2004
> @@ -345,7 +346,7 @@
> (?=\n+|\Z) # followed by a newline or end of document
> )
> }{
> - my $key = md5_hex($1);
> + my $key = md5_hex(encode_utf8($1));
> $g_html_blocks{$key} = $1;
> "\n\n" . $key . "\n\n";
> }egmx;
> @@ -365,7 +366,7 @@
> (?=\n+|\Z) # followed by a newline or end of document
> )
> }{
> - my $key = md5_hex($1);
> + my $key = md5_hex(encode_utf8($1));
> $g_html_blocks{$key} = $1;
> "\n\n" . $key . "\n\n";
> }egmx;
> @@ -387,7 +388,7 @@
> (?=\n{2,}|\Z) # followed by a blank line or end of document
> )
> }{
> - my $key = md5_hex($1);
> + my $key = md5_hex(encode_utf8($1));
> $g_html_blocks{$key} = $1;
> "\n\n" . $key . "\n\n";
> }egx;
> @@ -410,7 +411,7 @@
> (?=\n{2,}|\Z) # followed by a blank line or end of document
> )
> }{
> - my $key = md5_hex($1);
> + my $key = md5_hex(encode_utf8($1));
> $g_html_blocks{$key} = $1;
> "\n\n" . $key . "\n\n";
> }egx;
>
Show quoted text----- End forwarded message -----