in reply to Re^2: Do I have a unicode problem, or is this something else?
in thread Do I have a unicode problem, or is this something else?

So what I understand is the use utf8 that I have in my modules will just simplify any ... to ...

If you think this is an enhancement -- and you have no other reason for use utf8 in your code -- I would consider it a false "advantage", especially if you need (now or in the future) to add use Encode to your script, since you will then have a clash in how the decode() function is defined.

Did you notice this (rather prominent) passage in the perldoc "utf8" man page?

Do not use this pragma for anything else than telling Perl that your script is written in UTF-8.

(Italics added, bold in original.)

Replies are listed 'Best First'.
Re^4: Do I have a unicode problem, or is this something else?
by Steve_BZ (Chaplain) on Jun 10, 2010 at 17:03 UTC

    Hi Graff,

    Well in fact the first mechanism didn't work for me but the second did. I'm sure it was something to do with my own code! So I changed use utf8 to use Encode throughout and everything sprung to life, incluyding some code which I didn't know wasn't working! So now I have use Encode but not use utf8. Do you think that is OK?

    Regards

    Steve

      use utf8; tells perl that your source is encoded using UTF-8. If your source is encoded using UTF-8, you want to use use utf8;.

      If you use Encode's functions (e.g. encode($enc, $text) and decode($enc, $text)), then you'll want to load Encode and import its functions.