Skip Menu |

This queue is for tickets about the LaTeX-Encode CPAN distribution.

Report information
The Basics
Id: 79598
Status: resolved
Priority: 0/
Queue: LaTeX-Encode

People
Owner: ANDREWF [...] cpan.org
Requestors: CARNIL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Requres utf8::all for utf8 encoded strings
Date: Wed, 12 Sep 2012 21:13:55 +0200
To: bug-LaTeX-Encode [...] rt.cpan.org
From: Salvatore Bonaccorso <carnil [...] cpan.org>
Hi Gunnar Wolf reported to the Debian bugtracker[1], that LaTeX::Encode works as a module for for UTF8 output only in conjuction with utf8::all? See the example: ----cut---------cut---------cut---------cut---------cut---------cut----- #!/usr/bin/perl use strict; use warnings; use LaTeX::Encode; use utf8::all; my $text = 'Tħış ïš ffùĺł ȯff ŪŦḞ'; my $latex_string = latex_encode($text); use Data::Dumper; warn Dumper [ $latex_string ]; ----cut---------cut---------cut---------cut---------cut---------cut----- This produces $VAR1 = [ "T\x{127}{\\i}\\c{s} {\\\"i}\\v{s} \x{fb00}{\\`u}\\'{l}\x{142} \x{22f}\x{fb00} \\={U}\x{166}\\.{F}" ]; but removing the use of utf8:all still does not work. If so, and you agree, could that be at least added to the documentation? Many thanks for your work on this module! [1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602398#31 Regards, Salvatore
Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.

This is not a defect. The test script was passing in a string that contained UTF-8 character byte values, but did not have the UTF8 flag set. LaTeX::Encode upgraded the string, which results in a double-encoded string and hence the wrong LaTeX commands in the output. I have updated the documentation to warn about this "gotcha" and refer the users to the perlunicode, perluniintro and perlunitut man pages.