Are you familiar with Test::More

From what I can tell based on your posts, I appear to be much more familiar with Test::More than you appear to be.

I have tried to gently guide you to research the built-in way that Test::More has provided for setting UTF-8 mode on its outputs, analogous to the way that you have to set the encoding on STDOUT and STDERR, because Test::More uses its own filehandles, which cannot see the binmode settings you put on STDOUT and STDERR. I suggested studying the way that Test::More::UTF8 implemented it, so you could see that Test::More::UTF8 was nothing more than a convenience wrapper around the core binmode function being run on Test::More's filehandles.

When either that failed or you ignored my post, I then gave you the explicit code which you can use, including an SSCCE which shows how it behaves when those filehandles are not set to UTF-8 vs when they are set to UTF-8. But apparently, you did not see (or intentionally ignored) my second post as well.

At this point, you need to either understand my replies, or stop talking about Test::More, because it's obvious from your statements that you don't yet understand: you set UTF-8 encoding on Test::More's filehandles in exactly the same way you do on any other filehandle in Perl, using the binmode function: the code I showed is one way; using Test::More::UTF8 is another; but both are setting the binmode for you.

Many here aren't using UTF8 regularly enough to become aware of all the places where one's code must be adapted for it.

The point is, whether you are talking about Perl, Python, C/C++/C#, or any other programming language: any time you are dealing with UTF-8, you have to think about it. If you assume "it will just work without my thinking about it", you have already failed , because that is not true in any programming language. (There are occasional "happy accidents", where it accidentally works despite lack of thought. But if you are relying on happy accidents for successful code, you are truly in trouble.)

As a programmer dealing with UTF-8: Any time you read a file, think about it. Any time you write a file, think about it. Any time you send data from one application to anther (like when communicating with a database), think about it. Any time you get user input, think about it. Any time you are trying to develop a GUI interface that handles it (either in I/O or in the GUI labels, menus, etc), think about it. Because regardless of programming language, you must think about it in all those circumstances (and likely others) or you will fail.


In reply to Re^10: Converting Unicode by pryrt
in thread Converting Unicode by BernieC

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.