[Python-checkins] r84401 - python/branches/py3k/Objects/unicodeobject.c

victor.stinner python-checkins at python.org
Wed Sep 1 21:39:01 CEST 2010


Author: victor.stinner
Date: Wed Sep  1 21:39:01 2010
New Revision: 84401

Log:
Remove unicode_default_encoding constant

Inline its value in PyUnicode_GetDefaultEncoding(). The comment is now outdated
(we will not change its value anymore).


Modified:
   python/branches/py3k/Objects/unicodeobject.c

Modified: python/branches/py3k/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k/Objects/unicodeobject.c	(original)
+++ python/branches/py3k/Objects/unicodeobject.c	Wed Sep  1 21:39:01 2010
@@ -114,15 +114,6 @@
    shared as well. */
 static PyUnicodeObject *unicode_latin1[256];
 
-/* Default encoding to use and assume when NULL is passed as encoding
-   parameter; it is fixed to "utf-8".  Always use the
-   PyUnicode_GetDefaultEncoding() API to access this global.
-
-   Don't forget to alter Py_FileSystemDefaultEncoding if you change the
-   hard coded default!
-*/
-static const char unicode_default_encoding[] = "utf-8";
-
 /* Fast detection of the most frequent whitespace characters */
 const unsigned char _Py_ascii_whitespace[] = {
     0, 0, 0, 0, 0, 0, 0, 0,
@@ -1781,7 +1772,7 @@
 
 const char *PyUnicode_GetDefaultEncoding(void)
 {
-    return unicode_default_encoding;
+    return "utf-8";
 }
 
 /* create or adjust a UnicodeDecodeError */


More information about the Python-checkins mailing list