8000 Remove unicode_default_encoding constant · python/cpython@42cb462 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42cb462

Browse files
author
Victor Stinner
committed
Remove unicode_default_encoding constant
Inline its value in PyUnicode_GetDefaultEncoding(). The comment is now outdated (we will not change its value anymore).
1 parent e0f9863 commit 42cb462

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Objects/unicodeobject.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,6 @@ static PyUnicodeObject *unicode_empty;
114114
shared as well. */
115115
static PyUnicodeObject *unicode_latin1[256];
116116

117-
/* Default encoding to use and assume when NULL is passed as encod AA57 ing
118-
parameter; it is fixed to "utf-8". Always use the
119-
PyUnicode_GetDefaultEncoding() API to access this global.
120-
121-
Don't forget to alter Py_FileSystemDefaultEncoding if you change the
122-
hard coded default!
123-
*/
124-
static const char unicode_default_encoding[] = "utf-8";
125-
126117
/* Fast detection of the most frequent whitespace characters */
127118
const unsigned char _Py_ascii_whitespace[] = {
128119
0, 0, 0, 0, 0, 0, 0, 0,
@@ -1781,7 +1772,7 @@ Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
17811772

17821773
const char *PyUnicode_GetDefaultEncoding(void)
17831774
{
1784-
return unicode_default_encoding;
1775+
return "utf-8";
17851776
}
17861777

17871778
/* create or adjust a UnicodeDecodeError */

0 commit comments

Comments
 (0)
0