Search engine algorithms, file system paths, and HTTP routing protocols mandate URL slugs composed strictly of ASCII alphanumeric characters ([a-z0-9]) and safe delimiters (-). Accented international characters and Vietnamese tonal diacritics cause URI encoding explosions (%C3%A0 instead of a), broken URL shares, and impaired SEO ranking.
The SEO Slug & Vietnamese Normalizer strips tonal accents, handles Unicode decomposition, and constructs clean, search-engine-ready slug strings entirely in browser memory.
1. Vietnamese Diacritic Normalization Architecture
The Vietnamese language contains 5 tonal diacritics (sắc, huyền, hỏi, ngã, nặng) and modified vowel graphemes (ă, â, ê, ô, ơ, ư) along with the modified consonant đ/Đ.
Our engine applies a comprehensive dual-pass normalization mapping:
[ Input: "Học Lập Trình Next.js Tại Việt Nam" ]
│
▼ (Pass 1: Direct Regex Accent Mapping)
[ "Hoc Lap Trinh Next.js Tai Viet Nam" ]
│
▼ (Pass 2: Unicode NFD Decomposition)
[ Strips any residual combining diacritical marks \u0300-\u036f ]
│
▼ (Pass 3: Special Symbol Scrub & Hyphen Collapse)
[ "hoc-lap-trinh-nextjs-tai-viet-nam" ]
Character Mapping Reference Table:
| Vowel / Consonant | Accented Variations | Normalized ASCII Target |
|---|---|---|
| A | à, á, ạ, ả, ã, â, ầ, ấ, ậ, ẩ, ẫ, ă, ằ, ắ, ặ, ẳ, ẵ | a / A |
| E | è, é, ẹ, ẻ, ẽ, ê, ề, ế, ệ, ể, ễ | e / E |
| I | ì, í, ị, ỉ, ĩ | i / I |
| O | ò, ó, ọ, ỏ, õ, ô, ồ, ố, ộ, ổ, ỗ, ơ, ờ, ớ, ợ, ở, ỡ | o / O |
| U | ù, ú, ụ, ủ, ũ, ư, ừ, ứ, ự, ử, ữ | u / U |
| Y | ỳ, ý, y, ỷ, ỹ | y / Y |
| D | đ, Đ | d / D |
Secondary Pass: Unicode Canonical Decomposition (NFD)
To handle decomposed unicode sequences (where a base character and accent mark are stored as two distinct code points), the engine executes:
// Primary substitution map
result = result.replace(/[àáạảãâầấậẩẫăằắặẳẵ]/g, "a");
// ... mappings for e, i, o, u, y, d
// Secondary NFD pass removes orphaned combining diacritical marks
result = result.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
NOTE: Normalizing
đtodis crucial: standard Unicode NFD decomposition fails to strip the crossbar on the Vietnameseđbecause it is classified as a distinct base consonant rather than a diacritic mark. Our custom substitution map guarantees cleandnormalization.
2. Slug Configuration Parameters
- Separator Delimiter: Choose between hyphen
-(Google SEO recommended standard), underscore_, or period.. - Strip Numbers: Toggle removal of numeric digits (
0-9) when creating purely alphabetic routing identifiers. - Remove Special Symbols: Strips punctuation, brackets, currency symbols, and emojis.
- Force Lowercase: Converts all output characters to lowercase for uniform HTTP URL paths.
3. Step-by-Step Slug Workflow
[ Step 1: Input Title ] ──▶ [ Step 2: Choose Separator ] ──▶ [ Step 3: Copy SEO Slug ]
- Paste article titles, product names, or documentation headings into the input canvas.
- Select your desired delimiter (hyphen
-is selected by default). - The slug generator instantly produces the clean URL string and displays character and word counts.
- Click Copy Slug to copy the normalized slug for your CMS or routing config.