Re: weird string literal encoding
by Yu-ji Hosokawa other posts by this author
Jul 2 2009 11:50AM messages near this date
weird string literal encoding
|
Problem during remote debugging
Hello,
Same thing happens on an UTF-8 capable Linux terminal and Linux perlapp.
-- literal_test.pl
#!/opt/ActivePerl-5.10/bin/perl
use 5.010;
use utf8;
use ExternalTestPackage;
#use open IO => ':locale';
use open IO => ':utf8';
use open ':std';
say __PACKAGE__ . ": \x{a9}" . " ©"; # COPYRIGHT SIGN
ExternalTestPackage::say();
package InternalTestPackage;
say __PACKAGE__ . ": \x{a9}" . " ©";
package main;
say __PACKAGE__ . ": \x{a9}" . " ©";
say ExternalTestPackage::match('á'); # LATIN SMALL LETTER A WITH ACUTE
say ExternalTestPackage::match("\x{e1}"); # LATIN SMALL LETTER A WITH ACUTE
--
-- ExternalTestPackage.pm
package ExternalTestPackage;
use 5.010;
use utf8;
sub say {
say __PACKAGE__ . ": \x{a9}" . " ©";
}
sub match {
return ( shift =~ m/ [äáà ã] /msx ? 'match' : 'not match' );
}
1;
--
$ ./literal_test.pl
main: © ©
ExternalTestPackage: © ©
InternalTestPackage: © ©
main: © ©
match
match
$ /opt/pdk/bin/perlapp --clean --warnings --force --nologo literal_test.pl
$ ./literal_test
main: © ©
ExternalTestPackage: © é
InternalTestPackage: © ©
main: © ©
not match
not match
Please teach me, how to solve this problem.
thanks,
_______________________________________________
PDK mailing list
PDK@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Yu-ji Hosokawa
Yu-ji Hosokawa
|