digraphs: fix latin1 glyph conversion
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 6 Sep 2008 23:45:39 +0000 (23:45 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 16 Sep 2008 03:31:27 +0000 (03:31 +0000)
Under FastCGI, latin1 glyphs were displayed with their internal string
representation, because the output buffer was not :utf8 (FCGI flaw).
At least that's what I gather.  Force to Unicode beforehand so it's
shown correctly.

digraphs.plp

index 9a20f580dd8d405c30d8076618765fb78405c5ac..9f0b370b03fc5517199bae77a156550b4ce7443e 100644 (file)
@@ -69,11 +69,13 @@ for my $c1 (@chars) {
                        next;
                }
                my $chr = $di->{$mnem};
+               my $glyph = chr $chr;
+               utf8::upgrade($glyph);  # prevent latin1 output
 
                my @class = 'any';
 
                printf '<td class="%s" title="%s">%s',
-                       join(' ', @class), quote($mnem), quote(chr $chr);
+                       join(' ', @class), quote($mnem), quote($glyph);
        }
        print "\n";
 }