def to_unicode(data_str, encoding):
    """Convert a str object to unicode using the encoding given

    Characters that cannot be converted will be converted to '�' (the
    unicode replacement character).
    """
    return data_str.decode(encoding, 'w3lib_replace')
