Skip Menu |

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

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

People
Owner: ANDREWF [...] cpan.org
Requestors: LANTI [...] cpan.org
Cc: perl [...] lantschner.name
AdminCc:

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



CC: perl [...] lantschner.name
Subject: German Umlauts encoding
German Umlauts (Ä; ...) are encoded with a trailing space, even if in the middle or the beginning of a word. See the attached test. I recommend using a extended notation with curly-brackets as in the sub posted below. This should work well, regardless of the position of the Umlaut. sub enctex { my $strg = shift; $strg =~ s|&|\\&|; $strg =~ s|Ä|\{\\"A\}|; $strg =~ s|ä|\{\\"a\}|; $strg =~ s|Ö|\{\\"O\}|; $strg =~ s|ö|\{\\"o\}|; $strg =~ s|Ü|\{\\"U\}|; $strg =~ s|ü|\{\\"u\}|; $strg =~ s|ß|\{\\ss\}|; return $strg; }
Subject: 03-filter_umlauts.t
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 14; use blib; use LaTeX::Encode; use utf8; # Testing German Umlauts amd "scharfes S" (aka sz) is(latex_encode('Ä'), "\\\"A", "'Ä' - Single Umlaut A"); is(latex_encode('Ärger'), "\\\"Arger", "'Ä' - Umlaut A at beginning of word"); is(latex_encode('Märtyrer'), "M\\\"artyrer", "'ä' - Umlaut a in the middle of word"); is(latex_encode('wä'), "w\\\"a", "'ä' - Umlaut a at the end of word"); is(latex_encode('Ö'), "\\\"O", "'Ö' - Single Umlaut O"); is(latex_encode('Ü'), "\\\"U", "'Ü' - Single Umlaut U"); is(latex_encode('ä'), "\\\"a", "'ä' - Single Umlaut a"); is(latex_encode('ö'), "\\\"o", "'ö' - Single Umlaut o"); is(latex_encode('ü'), "\\\"u", "'ü' - Single Umlaut u"); is(latex_encode('ß'), "\\ss", "'ß' - Single scharfes S (sz)"); is(latex_encode('Straße'), "Stra\\ss e", "'ß' - scharfes S (sz) in the middle of the word"); is(latex_encode('Fuß'), "Fu\\ss", "'ß' - scharfes S (sz) at the end of the word"); # Scharfes S can *not* be ant the beginning of a word (at least not iun German) is(latex_encode('å'), "\\aa", "'å' - a ring "); is(latex_encode('åber'), "\\aa ber", "'å' - a ring at the beginning of the word");
Fixed in version 0.04, which has just been uploaded to CPAN.