Index: /pyyaml/trunk/lib/yaml/__init__.py
===================================================================
--- /pyyaml/trunk/lib/yaml/__init__.py	(revision 152)
+++ /pyyaml/trunk/lib/yaml/__init__.py	(revision 153)
@@ -188,5 +188,5 @@
     return dump_all([data], stream, Dumper=SafeDumper, **kwds)
 
-def add_implicit_detector(tag, regexp, first=None,
+def add_implicit_resolver(tag, regexp, first=None,
         Loader=Loader, Dumper=Dumper):
     """
Index: /pyyaml/trunk/lib/yaml/nodes.py
===================================================================
--- /pyyaml/trunk/lib/yaml/nodes.py	(revision 136)
+++ /pyyaml/trunk/lib/yaml/nodes.py	(revision 153)
@@ -8,16 +8,17 @@
     def __repr__(self):
         value = self.value
-        if isinstance(value, list):
-            if len(value) == 0:
-                value = '<empty>'
-            elif len(value) == 1:
-                value = '<1 item>'
-            else:
-                value = '<%d items>' % len(value)
-        else:
-            if len(value) > 75:
-                value = repr(value[:70]+u' ... ')
-            else:
-                value = repr(value)
+        #if isinstance(value, list):
+        #    if len(value) == 0:
+        #        value = '<empty>'
+        #    elif len(value) == 1:
+        #        value = '<1 item>'
+        #    else:
+        #        value = '<%d items>' % len(value)
+        #else:
+        #    if len(value) > 75:
+        #        value = repr(value[:70]+u' ... ')
+        #    else:
+        #        value = repr(value)
+        value = repr(value)
         return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value)
 
Index: /pyyaml/trunk/lib/yaml/emitter.py
===================================================================
--- /pyyaml/trunk/lib/yaml/emitter.py	(revision 143)
+++ /pyyaml/trunk/lib/yaml/emitter.py	(revision 153)
@@ -698,10 +698,11 @@
                 line_breaks = True
             if not (ch == u'\n' or u'\x20' <= ch <= u'\x7E'):
-                if ch < u'\x80' or ch == u'\uFEFF': # '\uFEFF' is BOM.
-                    special_characters = True
-                else:
+                if (ch == u'\x85' or u'\xA0' <= ch <= u'\uD7FF'
+                        or u'\uE000' <= ch <= u'\uFFFD') and ch != u'\uFEFF':
                     unicode_characters = True
                     if not self.allow_unicode:
                         special_characters = True
+                else:
+                    special_characters = True
 
             # Spaces, line breaks, and how they are mixed. State machine.
@@ -962,5 +963,7 @@
             if ch is None or ch in u'"\\\x85\u2028\u2029\uFEFF' \
                     or not (u'\x20' <= ch <= u'\x7E'
-                            or (self.allow_unicode and ch > u'\x7F')):
+                        or (self.allow_unicode
+                            and (u'\xA0' <= ch <= u'\uD7FF'
+                                or u'\uE000' <= ch <= u'\uFFFD'))):
                 if start < end:
                     data = text[start:end]
Index: /pyyaml/trunk/tests/test_representer.py
===================================================================
--- /pyyaml/trunk/tests/test_representer.py	(revision 150)
+++ /pyyaml/trunk/tests/test_representer.py	(revision 153)
@@ -7,10 +7,13 @@
 class TestRepresenterTypes(test_appliance.TestAppliance):
 
-    def _testTypes(self, test_name, data_filename, code_filename):
+    def _testTypesUnicode(self, test_name, data_filename, code_filename):
+        return self._testTypes(test_name, data_filename, code_filename, allow_unicode=True)
+
+    def _testTypes(self, test_name, data_filename, code_filename, allow_unicode=False):
         data1 = eval(file(code_filename, 'rb').read())
         data2 = None
         output = None
         try:
-            output = dump(data1, Dumper=MyDumper)
+            output = dump(data1, Dumper=MyDumper, allow_unicode=allow_unicode)
             data2 = load(output, Loader=MyLoader)
             self.failUnlessEqual(type(data1), type(data2))
@@ -43,3 +46,4 @@
 
 TestRepresenterTypes.add_tests('testTypes', '.data', '.code')
+TestRepresenterTypes.add_tests('testTypesUnicode', '.data', '.code')
 
Index: /pyyaml/trunk/tests/data/emitting-unacceptable-unicode-character-bug.data
===================================================================
--- /pyyaml/trunk/tests/data/emitting-unacceptable-unicode-character-bug.data	(revision 153)
+++ /pyyaml/trunk/tests/data/emitting-unacceptable-unicode-character-bug.data	(revision 153)
@@ -0,0 +1,1 @@
+u"\udd00"
Index: /pyyaml/trunk/tests/data/emitting-unacceptable-unicode-character-bug.code
===================================================================
--- /pyyaml/trunk/tests/data/emitting-unacceptable-unicode-character-bug.code	(revision 153)
+++ /pyyaml/trunk/tests/data/emitting-unacceptable-unicode-character-bug.code	(revision 153)
@@ -0,0 +1,1 @@
+u"\udd00"
