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 >> activepython
activepython
RE: String handling broken?
by Ueta Masayuki other posts by this author
Jun 27 2007 2:04PM messages near this date
view in the new Beta List Site
String handling broken? | RE: String handling broken?
Hi,
I'm working on Japanese version of Windows98.
I think Pyhton can handle Japananese filename.
How about this:
---------------------------------------------------------
C:\Scr\PY> python
ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
Python 2.5.1 (r251:54863, May  1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
> >> import os
> >> import re
> >> files = os.listdir('.')
> >> u = unicode(r'ã??ã?¤ã?½ã?³', "mbcs")
> >> pat = re.compile(u)
> >> for f in files:
...   f = unicode(f, "mbcs")
...   m = pat.search(f)
...   if m:
...     print f
...
ã??ã?¤ã?½ã?³.txt
ã??ã?¤ã?½ã?³.BAK
> >> import re
> >>
------------------------------------------------

_______________________________________________
ActivePython mailing list
ActivePython@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython
Thread:
Fuzzier
Ueta Masayuki
Fuzzier
Terry Carroll

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