code: def _to_unicode_soft(self, s):
          
          # We type-check to avoid "TypeError: decoding Unicode is not supported".
          # We avoid the Python ternary operator for Python 2.4 support.
          if isinstance(s, unicode):
              return s
          return self.unicode(s)
docs: Convert a basestring to unicode, preserving any unicode subclass.