diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1adc743..83efa81 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -165,9 +165,9 @@
 
  reset:
     /* Reset the object caches */
-    if (unicode->utf8str) {
-        Py_DECREF(unicode->utf8str);
-        unicode->utf8str = NULL;
+    if (unicode->defenc) {
+        Py_DECREF(unicode->defenc);
+        unicode->defenc = NULL;
     }
     unicode->hash = -1;
     
@@ -243,7 +243,7 @@
     unicode->str[length] = 0;
     unicode->length = length;
     unicode->hash = -1;
-    unicode->utf8str = NULL;
+    unicode->defenc = NULL;
     return unicode;
 
  onError:
@@ -262,9 +262,9 @@
 	    unicode->str = NULL;
 	    unicode->length = 0;
 	}
-	if (unicode->utf8str) {
-	    Py_DECREF(unicode->utf8str);
-	    unicode->utf8str = NULL;
+	if (unicode->defenc) {
+	    Py_DECREF(unicode->defenc);
+	    unicode->defenc = NULL;
 	}
 	/* Add to free list */
         *(PyUnicodeObject **)unicode = unicode_freelist;
@@ -273,7 +273,7 @@
     }
     else {
 	PyMem_DEL(unicode->str);
-	Py_XDECREF(unicode->utf8str);
+	Py_XDECREF(unicode->defenc);
 	PyObject_DEL(unicode);
     }
 }
@@ -529,6 +529,33 @@
     return NULL;
 }
 
+/* Return a Python string holding the default encoded value of the
+   Unicode object. 
+
+   The resulting string is cached in the Unicode object for subsequent
+   usage by this function. The cached version is needed to implement
+   the character buffer interface and will live (at least) as long as
+   the Unicode object itself.
+
+   The refcount of the string is *not* incremented.
+
+   *** Exported for internal use by the interpreter only !!! ***
+
+*/
+
+PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode,
+					    const char *errors)
+{
+    PyObject *v = ((PyUnicodeObject *)unicode)->defenc;
+
+    if (v)
+        return v;
+    v = PyUnicode_AsEncodedString(unicode, NULL, errors);
+    if (v && errors == NULL)
+        ((PyUnicodeObject *)unicode)->defenc = v;
+    return v;
+}
+
 Py_UNICODE *PyUnicode_AsUnicode(PyObject *unicode)
 {
     if (!PyUnicode_Check(unicode)) {
@@ -874,35 +901,6 @@
     return NULL;
 }
 
-/* Return a Python string holding the UTF-8 encoded value of the
-   Unicode object. 
-
-   The resulting string is cached in the Unicode object for subsequent
-   usage by this function. The cached version is needed to implement
-   the character buffer interface and will live (at least) as long as
-   the Unicode object itself.
-
-   The refcount of the string is *not* incremented.
-
-   *** Exported for internal use by the interpreter only !!! ***
-
-*/
-
-PyObject *_PyUnicode_AsUTF8String(PyObject *unicode,
-				  const char *errors)
-{
-    PyObject *v = ((PyUnicodeObject *)unicode)->utf8str;
-
-    if (v)
-        return v;
-    v = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
-			     PyUnicode_GET_SIZE(unicode),
-			     errors);
-    if (v && errors == NULL)
-        ((PyUnicodeObject *)unicode)->utf8str = v;
-    return v;
-}
-
 PyObject *PyUnicode_AsUTF8String(PyObject *unicode)
 {
     PyObject *str;
@@ -911,7 +909,9 @@
         PyErr_BadArgument();
         return NULL;
     }
-    str = _PyUnicode_AsUTF8String(unicode, NULL);
+    str = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
+			       PyUnicode_GET_SIZE(unicode),
+			       NULL);
     if (str == NULL)
         return NULL;
     Py_INCREF(str);
@@ -4519,7 +4519,7 @@
 			"accessing non-existent unicode segment");
         return -1;
     }
-    str = _PyUnicode_AsUTF8String((PyObject *)self, NULL);
+    str = _PyUnicode_AsDefaultEncodedString((PyObject *)self, NULL);
     if (str == NULL)
 	return -1;
     *ptr = (void *) PyString_AS_STRING(str);
@@ -5130,7 +5130,7 @@
 	u = *(PyUnicodeObject **)u;
 	if (v->str)
 	    PyMem_DEL(v->str);
-	Py_XDECREF(v->utf8str);
+	Py_XDECREF(v->defenc);
 	PyObject_DEL(v);
     }
     unicode_freelist = NULL;
