develooper Front page | perl.perl5.porters | Postings from May 2008

Re: on broken manpages, trolling, inconsistent implementation andthe difficulty to fix bugs

From:
John ORourke
Date:
May 19, 2008 22:39
Subject:
Re: on broken manpages, trolling, inconsistent implementation andthe difficulty to fix bugs
Message ID:
483263F4.7070106@o-rourke.org
Marc Lehmann wrote:
>
>>> part of the codebase) assuming this is just an internal flag,
>>> as originally designed, will kill perl in the long run.
>>>       
>> The end of the world is near, eh?
>>     
>
> I meet a lot of people who would like to use unicode in perl, but fail to do
> so because they run intot he problems mentioned and claim it should be much
> easier (yes, it should, and certainly less random).
>   

</lurk>
Just to throw in some more user experience - I'm very happy with perl's 
utf8 implementation.  I implemented utf8 handling in a large mod_perl 
application last year.  I knew nothing about unicode beforehand, read 
up, pored over the relevant man pages and was very happy with the results.

The worst that happens is my code warns about wide characters or invalid 
utf8 in input files, but the default settings handle everything quite 
gracefully.

Perhaps it's 20 years of coding experience but I didn't find the utf8 
flag difficult to work with - I've never had to touch a Devel::* module 
and I couldn't tell you what a dump of an SV looks like - all I use for 
utf8 manipulation is:

use utf8; (I ignore the advice on the man page and use it everywhere, so 
constant strings have the flag set)
encode_utf8, decode_utf8 (allowing me to force the flag either way and 
detect failures)
open($fh, "<:utf8", $file)

The only thing I'd consider a 'gotcha' is that for an easy life you 
either implement utf8 accross the whole application, or you don't 
implement it - but that's common sense really.

perl++

John




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About