Developer API & Open-Source Algorithm SDK
Integrate our high-performance Unicode converters, regional font decoders (InPage, Bijoy, Preeti, Zawgyi), zero-width steganography engines, and UAX #29 grapheme segmenters directly into your frontend and backend stacks.
100% In-Memory, Zero-Latency & Private by Architecture
All 61+ tools on iloveunicode.com execute 100% locally in browser memory without sending sensitive user text over any external network API. You can run these exact algorithms in Node.js, Next.js, Python, Rust, or Web Workers with zero latency.
1. Safe Grapheme Cluster Splitting (UAX #29)
Safely split strings containing multi-codepoint emojis (like 👨👩👧👦) or complex combining marks without corrupting bytes.
// TypeScript / Node.js 16+ (UAX #29 Grapheme Cluster Splitter)
export function splitGraphemes(text: string): string[] {
if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {
const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
return Array.from(segmenter.segment(text), s => s.segment);
}
// Fallback for older engines
return Array.from(text);
}
// Example:
const emoji = '👨👩👧👦';
console.log(emoji.length); // 7 (UTF-16 code units)
console.log(splitGraphemes(emoji).length); // 1 (Visual Grapheme)2. Zero-Width Invisible Watermarking & Steganography
Invisibly embed and extract secret binary tags using Zero-Width Space (U+200B) and Zero-Width Non-Joiner (U+200C).
// TypeScript: Zero-Width Steganography (U+200B / U+200C)
const ZW_ZERO = '\u200B'; // Zero Width Space = 0
const ZW_ONE = '\u200C'; // Zero Width Non-Joiner = 1
export function embedWatermark(text: string, secretId: string): string {
const binary = Array.from(secretId)
.map(c => c.charCodeAt(0).toString(2).padStart(8, '0'))
.join('');
const hidden = Array.from(binary)
.map(b => (b === '1' ? ZW_ONE : ZW_ZERO))
.join('');
return text.slice(0, 1) + hidden + text.slice(1);
}
export function extractWatermark(text: string): string {
const hidden = text.replace(/[^\u200B\u200C]/g, '');
let binary = '';
for (const c of hidden) binary += c === ZW_ONE ? '1' : '0';
let result = '';
for (let i = 0; i < binary.length; i += 8) {
const byte = binary.slice(i, i + 8);
if (byte.length === 8) result += String.fromCharCode(parseInt(byte, 2));
}
return result;
}3. Canonical Normalization (NFC/NFD) & Accent Stripper
Normalize strings to canonical forms and safely strip European diacritics and Arabic/Urdu Harakat (Zabar/Zer/Pesh).
// TypeScript: Unicode Normalization & Diacritic Stripping
export function stripDiacritics(text: string): string {
// Normalize to NFD (Decomposition) and strip combining marks (U+0300-U+036F and Arabic Harakat)
return text
.normalize('NFD')
.replace(/[\u0300-\u036F\u064B-\u065F]/g, '');
}
// Example:
console.log(stripDiacritics('Héllo Wörld')); // "Hello World"
console.log(stripDiacritics('مُحَمَّد')); // "محمد"Best Practices for Unicode Text Processing in Production Backends
When processing user-submitted international text across distributed databases, APIs, and microservices, engineers must avoid common encoding pitfalls:
Frequently Asked Questions (FAQs)
Can I use these snippets in commercial SaaS applications?+
Yes! All code snippets published in our developer documentation are MIT licensed and free to embed in open-source and commercial products.
Why does Python 3 handle Unicode differently from JavaScript?+
Python 3 strings are sequences of Unicode codepoints (Flexible String Representation PEP 393), whereas JavaScript strings are indexed by 16-bit UTF-16 code units, requiring Intl.Segmenter or regex surrogates for astral emojis.
How do I detect homoglyphs and phishing URLs programmatically?+
Inspect the Unicode script of each character in the domain. If a domain mixes Latin (U+0041) and Cyrillic (U+0430) letters within the same label, flag it as a potential IDN homograph phishing attempt.