ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pdk
pdk
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved