doc:appunti:prog:python_unicode
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
doc:appunti:prog:python_unicode [2013/01/28 10:05] – [Nomi di file e directory] niccolo | doc:appunti:prog:python_unicode [2013/01/28 13:09] – [Nomi di file e directory] niccolo | ||
---|---|---|---|
Line 77: | Line 77: | ||
<code python> | <code python> | ||
os.path.isfile(filename) | os.path.isfile(filename) | ||
+ | os.stat(filename) | ||
</ | </ | ||
Line 84: | Line 85: | ||
UnicodeEncodeError: | UnicodeEncodeError: | ||
</ | </ | ||
+ | |||
+ | La soluzione è codificare esplicitamente la stringa prima di passarla alla funzione: | ||
+ | |||
+ | <code python> | ||
+ | os.path.isfile(filename.encode(' | ||
+ | os.stat(filename.encode(' | ||
+ | </ | ||
+ |
doc/appunti/prog/python_unicode.txt · Last modified: 2015/07/17 09:50 by niccolo