summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2009-05-10 08:15:24 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2009-05-10 08:15:24 (GMT)
commit43c57785d3319249c03c3fa46c9df42a8ccd3e52 (patch)
tree199d57826897ac525b4057253a82aaaefcb6ef82 /Modules
parente0a2b72e61a474dceb948be57cb2983f70ab07fb (diff)
downloadcpython-43c57785d3319249c03c3fa46c9df42a8ccd3e52.zip
cpython-43c57785d3319249c03c3fa46c9df42a8ccd3e52.tar.gz
cpython-43c57785d3319249c03c3fa46c9df42a8ccd3e52.tar.bz2
Rename utf8b error handler to surrogateescape.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/fileio.c2
-rw-r--r--Modules/posixmodule.c10
-rw-r--r--Modules/python.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 164f7e4..555dc12 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -245,7 +245,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
return -1;
stringobj = PyUnicode_AsEncodedString(
- u, Py_FileSystemDefaultEncoding, "utf8b");
+ u, Py_FileSystemDefaultEncoding, "surrogateescape");
Py_DECREF(u);
if (stringobj == NULL)
return -1;
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 2050d5a..21dcb4d 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -494,13 +494,13 @@ convertenviron(void)
if (p == NULL)
continue;
k = PyUnicode_Decode(*e, (int)(p-*e),
- Py_FileSystemDefaultEncoding, "utf8b");
+ Py_FileSystemDefaultEncoding, "surrogateescape");
if (k == NULL) {
PyErr_Clear();
continue;
}
v = PyUnicode_Decode(p+1, strlen(p+1),
- Py_FileSystemDefaultEncoding, "utf8b");
+ Py_FileSystemDefaultEncoding, "surrogateescape");
if (v == NULL) {
PyErr_Clear();
Py_DECREF(k);
@@ -2167,7 +2167,7 @@ posix_getcwd(int use_bytes)
return posix_error();
if (use_bytes)
return PyBytes_FromStringAndSize(buf, strlen(buf));
- return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"utf8b");
+ return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"surrogateescape");
}
PyDoc_STRVAR(posix_getcwd__doc__,
@@ -2513,7 +2513,7 @@ posix_listdir(PyObject *self, PyObject *args)
w = PyUnicode_FromEncodedObject(v,
Py_FileSystemDefaultEncoding,
- "utf8b");
+ "surrogateescape");
Py_DECREF(v);
if (w != NULL)
v = w;
@@ -4695,7 +4695,7 @@ posix_readlink(PyObject *self, PyObject *args)
w = PyUnicode_FromEncodedObject(v,
Py_FileSystemDefaultEncoding,
- "utf8b");
+ "surrogateescape");
if (w != NULL) {
Py_DECREF(v);
v = w;
diff --git a/Modules/python.c b/Modules/python.c
index 4c0a55b..13c6d5b 100644
--- a/Modules/python.c
+++ b/Modules/python.c
@@ -42,7 +42,7 @@ char2wchar(char* arg)
return res;
PyMem_Free(res);
}
- /* Conversion failed. Fall back to escaping with utf8b. */
+ /* Conversion failed. Fall back to escaping with surrogateescape. */
#ifdef HAVE_MBRTOWC
/* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */