Dev.to WebDev 🛠 Dev 👁 0 📖 4 min read

Unicode Symbols in Usernames and Bios — A Practical Guide for Developers

Every day, millions of users decorate their Discord names, Instagram bios and game profiles with hearts, stars, sparkles and kaomoji like ♡, ✧ and (˶ᵔᵕᵔ˶). If you build anything with profiles, comments or display names,

Every day, millions of users decorate their Discord names, Instagram bios and game profiles with hearts, stars, sparkles and kaomoji like ♡, ✧ and (˶ᵔᵕᵔ˶). If you build anything with profiles, comments or display names, you will meet these characters in production — usually as a bug report.

This guide explains what these symbols actually are, where they work, where they break, and how to handle them safely in your code.

They are not images or fonts — they are just text

A heart pasted into a bio is an ordinary Unicode code point, exactly like the letter A:

Character Code point Name
♥ U+2665 Black Heart Suit
★ U+2605 Black Star
✧ U+2727 White Four-Pointed Star
♪ U+266A Eighth Note
♡ U+2661 White Heart Suit

That is why copy and paste works everywhere: the clipboard carries the character itself, not a picture. Whatever app receives it asks the system font to draw it. If the font has the glyph, it renders; if not, the user sees a hollow box (□) — the famous "tofu". Render support differs between Windows, Android and iOS, which is why a symbol that looks perfect on your phone can arrive as an empty square on someone else's screen.

The three families you will see

1. Standalone symbols. Single characters: hearts, stars, arrows, crowns, musical notes. Safest of the three — one character, one glyph.

2. Kaomoji. Japanese text faces built from several characters, like (。◕‿◕。) or ʕ•ᴥ•ʔ. Still plain text, but many code points — string length and truncation start to matter here.

3. Combining marks. Characters like Zalgo text stack dozens of combining diacritics on one base letter: t̴̢̧̛h̶̝i̶s̶. One visible "letter" can be 30+ code points. This is where naive counting, truncation and layout code goes to die.

Platform rules are not consistent

If your app lets users import or mirror profiles from other platforms, expect every platform to treat symbols differently:

  • Discord — display names accept most symbols; usernames are restricted to lowercase letters, numbers and a few marks.
  • Instagram / TikTok — bios and display names accept almost anything that renders; usernames stay ASCII-only.
  • Roblox — display names can contain symbols (free to change once a week); usernames are letters, numbers and a single underscore.
  • X (Twitter) — display names are permissive, handles are not.

The pattern: display surfaces are permissive, identifiers are strict. Mirror that in your own product.

Four developer pitfalls (learned the hard way)

1. .length lies to you.
In JavaScript, "♥".length is 1, but "𖹭".length is 2 (a surrogate pair) and a kaomoji can be 10+. Count grapheme clusters — what the user perceives as one character:

const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
const count = [...segmenter.segment('(。◕‿◕。)')].length; // what the user sees

2. Normalize before you compare or search.
The same visible text can be stored in different Unicode normalization forms. Normalize with NFC before storing, and keep a "plain" version for search: strip decorations and fold styled letters back to ASCII, or a user named ★彡[Name]彡★ will never be found by searching "Name".

const plain = name.normalize('NFKD').replace(/\p{M}/gu, '');

3. Validation: use Unicode property escapes.
Instead of blacklisting characters one by one, decide what you allow:

// Letters, numbers, spaces and common symbols — in any language
const ok = /^[\p{L}\p{N}\p{S} ]+$/u.test(displayName);

4. Your database needs real UTF-8.
On MySQL, that means utf8mb4 — plain utf8 silently drops or chokes on characters outside the Basic Multilingual Plane. Many "rare" symbols and all emoji live out there.

Where to find symbols that actually render

When users ask "where do I get a star that works in my bio?", they need characters with wide font support, not exotic code points that tofu on half the devices. I keep a bookmark on Cute Symbols for this — it is a free click-to-copy library of 1,000+ symbols in 42 categories (hearts, stars, arrows, kaomoji, dot art and more), organised by use case. Their Discord symbols collection, for example, is handy when testing how decorated names behave, because everything there is plain copyable text rather than images.

The rule of thumb when picking symbols for your own UI or test data: prefer code points from the BMP with years of font support (★ ♥ ♡ ✧ ♪ ➤) and avoid freshly-added or niche blocks unless you have tested them on real devices.

TL;DR

  • Pasted symbols are ordinary Unicode characters — that is why they work everywhere, and why they sometimes tofu.
  • Display names and identifiers need different rules; every major platform treats them differently.
  • Count graphemes, normalize with NFC, keep a stripped plain-text field for search, validate with \p{...} escapes, and store utf8mb4.
  • Test with real decorated names — a kaomoji in your seed data will find bugs your QA never will.

Have you been bitten by a Unicode edge case in production? I would love to hear it in the comments.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.