perl-unicode

Re: Perl 5.6.1 and regex captures

2002-02-28 08:58:50
Hi again,

Sorry to send so many messages, but one of my colleagues told me that
the sample script I've sent wasn't clear enough. So here is my problem
stripped down as much as I can:

[jhiver(_at_)frogette mkdoc]$ cat test2.pl 
use strict;
use utf8;

my $data = "Copyright \x{A9} 2001-2002 MKDoc Ltd";
print $data, "\n";
print $data =~ /(.*)/, "\n";


[jhiver(_at_)frogette mkdoc]$ perl test2.pl 
Copyright © 2001-2002 MKDoc Ltd
Copyright © 2001-2002 MKDoc Ltd


As you can see, the string has been converted from utf-8 to latin1 just
by capturing the string... How come? How to avoid it? I've performed
several 'perl unicode regex capture' like searches on google but came
with no relevant hits :-(

Cheers,
-- 
IT'S TIME FOR A DIFFERENT KIND OF WEB
================================================================
  Jean-Michel Hiver - Software Director
  jhiver(_at_)mkdoc(_dot_)com
  +44 (0)114 221 4968
================================================================
                                      VISIT HTTP://WWW.MKDOC.COM

<Prev in Thread] Current Thread [Next in Thread>