in reply to why no default unicode?
There are two good reasons. The first is backwards compatibility. Perl tries very hard not to break old programs, and there are a lot of old programs that would be broken by such a change.
The second reason is that as it is now, a program as simple as
while(<>) { print; }
Just works, ie it print out the same data as it reads. If STDOUT defaulted to UTF-8, it would also need to default to UTF-8 for reading operations.
And when that's the default, suddenly reading a non-UTF-8 file will cause either a fatal error, or that the data can't be interpreted correctly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: why no default unicode?
by perl-diddler (Chaplain) on Mar 19, 2011 at 23:54 UTC | |
by moritz (Cardinal) on Mar 20, 2011 at 07:24 UTC |