Many thanks to both of you, and sorry for the somewhat belated answer. I have to admit I had worked under the impression that UTF-8 works out of the box with Perl, and had to read up a lot on that. I have now understood that you should not rely on that, even if it mostly looks like it. The fix using both use utf8 and use open ':encoding(UTF-8) worked perfectly for me as well. The suggestion of using strftime for the numbers only would definitely have been a workable fallback solution that I hadn't thought of.

The only thing that really puzzles me is the different outcome between the non-breaking space and the other non-ASCII characters. But then, it seems Perl has to do quite complex things around Unicode.

Thanks again, and best wishes!


In reply to Re^2: strftime does not handle Unicode characters in format argument properly (at least, not consistently) by Bruder Savigny
in thread strftime does not handle Unicode characters in format argument properly (at least, not consistently) by Bruder Savigny

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.