in reply to Re: Whether 'use utf8;' is good style
in thread Whether 'use utf8;' is good style
Hi,
thank you for your comment. After your answer I've seen that the context of my question was not precise enough.
Take the following example:
die ("Was für ein Müll!");
This is a German string saying "What a rubbish!". There are umlauts in that string. When I store this source code file Latin-1 encoded there is one byte per German umlaut. The string is interpreted as a byte string. And this byte string gets interpreted correctly as Perl assumes Latin-1 encoding. But: When you run in an UTF-8 environment you would see a square and not an 'ü' when the program dies. When you use ONLY Ascii characters it doesn't matter and you're never aware of this subtle difference.
So with use utf8; and a correct source code file encoding I would force a character semantic of this string which would result in a subtle different semantic of the string thrown.
And I want to know whether there are pitfalls, when someone is using a module with that pragma probably expecting the good old byte string world.
Best regards
McA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Whether 'use utf8;' is good style
by chromatic (Archbishop) on Dec 18, 2012 at 17:03 UTC | |
by Anonymous Monk on Dec 18, 2012 at 18:57 UTC | |
by chromatic (Archbishop) on Dec 18, 2012 at 22:23 UTC | |
|
Re^3: Whether 'use utf8;' is good style
by grantm (Parson) on Dec 20, 2012 at 03:59 UTC | |
|
Re^3: Whether 'use utf8;' is good style
by space_monk (Chaplain) on Dec 19, 2012 at 12:22 UTC |