[Python-3000] Unicode and OS strings (original) (raw)
Jim Jewett jimjjewett at gmail.com
Fri Sep 14 15:39:31 CEST 2007
- Previous message: [Python-3000] Unicode and OS strings
- Next message: [Python-3000] Unicode and OS strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 9/14/07, Hagen Fürstenau <hagenf at coli.uni-sb.de> wrote:
Is it too unreasonable to keep the byte strings we get from the OS as byte strings in Python (since we're not sure about their encoding) and offer functions for getting strings?
sys.argv could be of type bytes and sys.arguments (or whatever) could be a function taking an encoding parameter (which defaults to UTF-8) and returning strings.
Of course that's backwards incompatible and I'm not sure if it's too late for something like this now.
For that reason alone, it makes sense to do it the other way. sys.argv is the text string, and sys.arguments is a bytes object which can be decoded if you know the encoding. sys.argv == sys.arguments(best_guess)
-jJ
- Previous message: [Python-3000] Unicode and OS strings
- Next message: [Python-3000] Unicode and OS strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]