in reply to Re^2: bug in utf8 handling?
in thread bug in utf8 handling?
The Encode pragma is nice, but if I use that, I have to put encode in all places I use a literal string or print out something (the program I'm working on is 7000 lines at the moment). And more importantly I hardcode every detail of my environment in my script. If I do that, it should at least be only in one place.
Binmode looks promising besides using -C, but both have the disadvantage of hardcoding the machine/platform into the script. But I see your point with binary files.
Essentially I will have to create a subroutine that finds out whether I'm on an utf8 machine and read text files accordingly.
About your last point about 'use utf8;': Sure that may be its purpose, but it also changes the meaning of string literals in the script. If I want to use 'ä' in a string literal and have it interpreted/manipulated correctly, I may have to use the pragma. Or use \x or \N anywhere I have an Umlaut, which is quite painful I guess.
But thanks alot, your message was most informative. What I didn't understand was your comment about dropping -c on utf8 text files? Did you mean -C or something else?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: bug in utf8 handling?
by jethro (Monsignor) on Oct 04, 2006 at 18:24 UTC | |
|
Re^4: bug in utf8 handling?
by graff (Chancellor) on Oct 16, 2006 at 09:02 UTC |