I have this script:
#!perl use strict; use warnings; use charnames ":full"; my @letters = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z); my %accents = ( grave => chr(0x300), acute => chr(0x301), circumflex => chr(0x302), tilde => chr(0x303), breve => chr(0x306), diaeresis => chr(0x308), ring => chr(0x30A), doubleacute => chr(0x30B), doublegrave => chr(0x30F), cedilla => chr(0x327), ); open MEHH, ">unicode.txt"; binmode(MEHH, ":utf8"); foreach my $letter (@letters) { my $capital = -1; for (1..2) { $capital++; foreach my $accent (keys %accents) { my $name = "LATIN " . ($capital ? "CAPITAL " : "SMALL ") . + "LETTER " . uc($letter); print MEHH chr(charnames::vianame($name)) . "$accents{$acc +ent} ($name $accent)\n"; } print MEHH "\n"; } print MEHH "\n\n"; } close MEHH;
As you can see, it has to add certain accents to all letters of the alphabet, both lowercase and uppercase.
These accents are the Combining Diacritical Marks.
According to the unicode website, this means that the accent (or diacritical mark) is applied to the preceding character.
Well, nice, you'd say. But the problem is: it doesn't. Every Combining Diacritical Mark is displayed as a 0.

Why? What do I do wrong? How should I do this?




"2b"||!"2b";$$_="the question"
Besides that, my code is untested unless stated otherwise.
One more: please review the article about regular expressions (do's and don'ts) I'm working on.

In reply to Problem with unicode combination diacritics by muba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.