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
|