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/2008-September/082598.html below:

[Python-Dev] Filename as byte string in python 2.6 or 3.0?

[Python-Dev] Filename as byte string in python 2.6 or 3.0? [Python-Dev] Filename as byte string in python 2.6 or 3.0?Victor Stinner victor.stinner at haypocalc.com
Mon Sep 29 13:37:29 CEST 2008
Le Monday 29 September 2008 12:50:03 Ulrich Eckhardt, vous avez écrit :
> (...) uses an ASCII mapping where possible and codepoints from the 
> "Private Use Area" (PUA) of Unicode for the non-decodable bytes.

That sounds to me like a very *ugly* hack.

It remembers me my proposition to create an object have the API of both bytes 
and str types: str(<Filename object>) = human representation of the filename, 
bytes(<Filename>) = original bytes filename. As I wrote in the first email of 
this thread, it's not a good idea to mix bytes and characters.

Why trying to convert bytes to characters when the operating system expects 
bytes? To get the best compatibility, we have to use the native types, at 
least when str(filename, fs_encoding) fails and/or str(filename, 
fs_encoding).encode(fs_encoding) != filename.

-- 
Victor Stinner aka haypo
http://www.haypocalc.com/blog/
More information about the Python-Dev mailing list

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