A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-April/003767.html below:

[Python-Dev] fun with unicode, part 1

[Python-Dev] fun with unicode, part 1 [Python-Dev] fun with unicode, part 1M.-A. Lemburg mal@lemburg.com
Thu, 27 Apr 2000 12:27:18 +0200
Fredrik Lundh wrote:
> 
> >>> filename = u"gröt"
> 
> >>> file = open(filename, "w")
> >>> file.close()
> 
> >>> import glob
> >>> print glob.glob("gr*")
> ['gr\303\266t']
> 
> >>> print glob.glob(u"gr*")
> [u'gr\366t']
> 
> >>> import os
> >>> os.system("dir gr*")
> ...
> GRÇôT                    0  01-02-03  12.34 grÇôt
>          1 fil(es)              0 byte
>          0 dir         12 345 678 byte free
> 
> hmm.

Where is the problem ? If you pass the output of glob()
to open() you'll get the same file in both cases...
even better, you can now even use Chinese in your filenames
without the OS having to support Unicode filenames :-)

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4