Did I find the right examples for you? yes no

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
This method is similar to the builtin `unicode`, except
that it may try multiple encodings to find one that works
for decoding `value`, and defaults to 'utf-8' first.

:param: value: the value to convert
:param: hint_encoding: an optional encoding that was detecte
    upstream and should be tried first to decode ``value``.
:param str errors: optional `errors` flag to pass to the unicode
    built-in to indicate how illegal character values should be
    treated when converting a string: 'strict', 'ignore' or 'replace'(more...)

        def ustr(value, hint_encoding='utf-8', errors='strict'):
    """This method is similar to the builtin `unicode`, except
    that it may try multiple encodings to find one that works
    for decoding `value`, and defaults to 'utf-8' first.

    :param: value: the value to convert
    :param: hint_encoding: an optional encoding that was detecte
        upstream and should be tried first to decode ``value``.
    :param str errors: optional `errors` flag to pass to the unicode
        built-in to indicate how illegal character values should be
        treated when converting a string: 'strict', 'ignore' or 'replace'
        (see ``unicode()`` constructor).
        Passing anything other than 'strict' means that the first
        encoding tried will be used, even if it's not the correct
        one to use, so be careful! Ignored if value is not a string/unicode.
    :raise: UnicodeError if value cannot be coerced to unicode
    :return: unicode string representing the given value
    """
    if isinstance(value, Exception):
        return exception_to_unicode(value)

    if isinstance(value, unicode):
        return value

    if not isinstance(value, basestring):
        try:
            return unicode(value)
        except Exception:
            raise UnicodeError('unable to convert %r' % (value,))

    for ln in get_encodings(hint_encoding):
        try:
            return unicode(value, ln, errors=errors)
        except Exception:
            pass
    raise UnicodeError('unable to convert %r' % (value,))
        


src/o/p/openerp_proxy-0.1/openerp_proxy/core.py   openerp_proxy(Download)
# project imports
from utils import AttrDict
from utils import ustr
 
 
                                    u"Fault code: %s\n"
                                    u"Fault string: %s\n"
                                    u"" % (ustr(exc.faultCode),
                                           ustr(exc.faultString)))
        return res