RepoPilot

How does this library handle transliteration of non-ASCII characters?

About sindresorhus/slugify · 2 messages · last activity 6/8/2026

Question

How does this library handle transliteration of non-ASCII characters?

RepoPilot

Based on the README, the sindresorhus/slugify library handles transliteration of non-ASCII characters by leveraging an underlying transliteration module. According to the documentation:

It handles most major languages, including German (umlauts), Vietnamese, Arabic, Russian, and more.

The README demonstrates this with several examples:

  • 'Déjà Vu!''deja-vu' (French accents)
  • 'я люблю единорогов''ya-lyublyu-edinorogov' (Russian Cyrillic)

However, the thin index coverage means the actual implementation details are not available in the indexed source code. To understand the specific transliteration algorithm and how it handles each language, you would need to examine the main implementation file directly. Based on the file structure, the entry point is likely index.js or index.ts, which you should read to see how the library integrates transliteration logic.

The README references that more details on supported languages are available at the sindresorhus/transliterate repository, which is likely a separate dependency used internally for the actual character conversion.

FOLLOW_UPS:

  • What are the default custom replacements?
  • How does the decamelize option work internally?
  • Can I add custom transliteration rules?

Want to ask your own question?

Open chat for sindresorhus/slugify

Public Q&A. Generated by RepoPilot from the actual source of sindresorhus/slugify. AI answers can be incomplete or stale — verify before relying on them.