🛠️ToolsShed

Inspecteur Unicode

Inspectez le point de code, le nom, la catégorie et l'entité HTML de n'importe quel caractère.

Tapez ou collez des caractères...

Questions Fréquentes

Implémentation du Code

def inspect_unicode(text: str):
    """Print Unicode code point details for each character."""
    for char in text:
        cp = ord(char)
        try:
            import unicodedata
            name = unicodedata.name(char, "UNKNOWN")
            category = unicodedata.category(char)
        except Exception:
            name = "UNKNOWN"
            category = "??"

        # UTF-8 bytes
        utf8_bytes = char.encode("utf-8")
        utf8_hex = " ".join(f"{b:02X}" for b in utf8_bytes)

        print(f"U+{cp:04X}  {char!r:6}  {name:<40}  {category}  UTF-8: {utf8_hex}")


inspect_unicode("Hello €")
# U+0048  'H'    LATIN CAPITAL LETTER H                    Lu  UTF-8: 48
# U+0065  'e'    LATIN SMALL LETTER E                      Ll  UTF-8: 65
# ...
# U+20AC  '€'    EURO SIGN                                 Sc  UTF-8: E2 82 AC

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.