def upper(s):
    """French-accents-aware variant of string.upper."""
    isUnicode = isinstance(s, str)
    if not isUnicode:
        s = s.decode('utf-8')
    res = s.upper()
    if not isUnicode:
        res = res.encode('utf-8')
    return res
