import locale


def decode_byte_str(byte_str):
    """
    Decodes byte string into unicode string.

    Args:
        byte_str(byte): Byte string.

    Returns:
        Unicode string.
    """

    # first try to decode with utf-8 and if that fails try with system default
    for encoding in ("utf-8", locale.getpreferredencoding()):
        try:
            res = byte_str.decode(encoding)
            return res
        except Exception:
            continue
    else:
        return str(byte_str)