Timeline for UTF-8 and os.listdir()
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 8, 2021 at 7:20 | comment | added | Martijn Pieters | @Superdooperhero no. Windows does not perform any normalisation on pathnames. See stackoverflow.com/questions/7041013/…. | |
| Jun 8, 2021 at 5:31 | comment | added | Superdooperhero | Would the same go for Windows 10? | |
| May 19, 2016 at 17:16 | comment | added | Martijn Pieters |
@NamPham: all you need is a unicode object. If your variable is a str object, you'll first need to decode.
|
|
| May 19, 2016 at 15:34 | comment | added | Nam Pham |
I'm faceing about decoding and encoding process, I can't put u'.' as an argument for listdir. My path is unicode :(
|
|
| May 19, 2016 at 11:20 | comment | added | Martijn Pieters |
@NamPham: do what exactly, what problem are you facing? The files list will contain a list of Unicode string objects, each normalised.
|
|
| May 19, 2016 at 11:18 | comment | added | Nam Pham | @Unknown how can you do that? I'm facing with that problem tooo | |
| Nov 4, 2014 at 11:35 | history | edited | Martijn Pieters | CC BY-SA 3.0 |
added 106 characters in body
|
| Nov 4, 2014 at 11:04 | comment | added | Martijn Pieters | @Unknown: right, or decode and again encode. But using a unicode path is better. | |
| Nov 4, 2014 at 11:04 | history | edited | Martijn Pieters | CC BY-SA 3.0 |
added 1 character in body
|
| Nov 4, 2014 at 11:03 | vote | accept | Unknown | ||
| Nov 4, 2014 at 11:03 | comment | added | Unknown |
Thanks for the link, I understand what's going on now. Your code is not working btw, I need to do u"ș.txt" in [unicodedate.normalize('NFC', f) for f in os.listdir(u'.')] instead.
|
|
| Nov 4, 2014 at 10:40 | history | answered | Martijn Pieters | CC BY-SA 3.0 |