import base64


def base64decode(value: str):
    """Decode base64 string."""
    try:
        return base64.b64decode(value).decode("utf-8").strip()
    except UnicodeDecodeError:
        return base64.b64decode(value).decode("cp1254").strip()