I tried unsuccessfully the following:use open ":utf8"; binmode(STDIN,":utf8"); binmode(STDOUT, ":utf8");

Well, that's another problem. Maybe you should start a new thread instead of leaving it buried this deep in this thread?

I suspect that the "automatic" string upgrade when concatenation occurs which is enabled with use encoding 'utf8' is mandatory for utf8 templates to work (haven't checked its code though).

"which is enabled with use encoding 'utf8'" is untrue. use encoding has nothing to do with it.

use Encode qw( is_utf8 ); my $s1 = "abc"; my $s2 = chr(0x2660); my $s = $s1 . $s2; print("s1: ", is_utf8($s1)?1:0, "\n"); # 0 print("s2: ", is_utf8($s2)?1:0, "\n"); # 1 print("s: ", is_utf8($s )?1:0, "\n"); # 1

additionnaly I need use locale; in order to use my locale collation.

I only removed it because it was irrelevant to the question I was addressing. Feel free to re-add it.


In reply to Re^5: utf8, locale and regexp by ikegami
in thread utf8, locale and regexp by Anonymous Monk

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.