About this tool
Most Khmer users today work in Unicode — it is the encoding phones, browsers and modern design tools render correctly. But a real slice of professional work in Cambodia still runs on legacy Khmer fonts: print shops typesetting in Adobe InDesign CS6, sign cutters whose software only reads Limon bytes, government templates authored in Khek, publishers reprinting pre-2010 books laid out in ABC-Zwsp. Those workflows cannot open a Unicode file at all — they need the text as legacy bytes. This Unicode to Khmer legacy font converter bridges that gap: paste your modern Khmer text, pick Limon, ABC-Zwsp or Khek, and copy the encoded output or download it as a Windows-1252 .txt file the legacy tool can import. A Unicode to Limon conversion, a Unicode to Khek conversion and a Unicode to ABC-Zwsp conversion are three different byte outputs from the same input — the Khmer legacy font converter applies the exact table for whichever target you select, so the file you hand to the print shop draws correctly in their font. One honest note before you start: the output looks like gibberish Latin characters until it is opened inside the matching legacy font — that is normal, it is exactly how the legacy encoding works, not a bug.
How it works
Pressing Convert runs convertUnicodeToLegacy from lib/khmer-legacy-converter/converter.ts in your browser, under the encoding you picked — there is no auto-detect here because the input is already Unicode and the question is which table to emit, not which to decode. Each Unicode Khmer codepoint has a mapped byte in the target table, but the pass cannot simply swap one for one: Khmer subscripts are two codepoints in Unicode — U+17D2 (coeng) followed by a base consonant — while the legacy font stores the subscript as a single byte drawn below its base. The converter therefore reorders every cluster into the font's visual order first (reorder.ts: legacyReorder, which also inserts U+17EA position marks the emission pass consumes), so when it meets U+17D2 it looks ahead, consumes the following consonant codepoint, and emits the one subscript byte — this is where naïve implementations silently lose characters. Anything without a table entry passes through unchanged and is counted in the unmapped chip; spacing and line breaks pass through untouched. Inputs over 10 KB convert inside a Web Worker; smaller text runs on the main thread, entirely client-side — only size counters ever appear in anonymous telemetry. The output renders correctly only inside the matching legacy font, which is why the download writes literal Windows-1252 bytes rather than UTF-8.
Use cases
- A designer preparing a leaflet in Adobe InDesign CS6 where the Khmer font is Limon-only and the copy was written in modern Unicode.
- A print shop producing a wedding invitation on a legacy workflow that still runs on Limon fonts.
- A government officer formatting a document in an older template that requires Khek-encoded text to render on an unreplaced legacy printer.
- A publisher reissuing a classic Khmer book whose typesetting is in ABC-Zwsp and whose new material was written in Unicode.
- A software developer generating fallback Limon exports for users on older Windows systems without a Unicode Khmer font installed.
- A signwriter whose cutting software only accepts Limon byte input.
- An archivist preparing a legacy-font facsimile of a Unicode document for a publication that must match an original 1990s edition.
Verified conversion examples
| Encoding | Legacy text | Unicode Khmer |
|---|---|---|
| limon | sYsþI bgb¥Ún | សួស្តី បងប្អូន |
| limon | sMNYr nigcemøIy GMBI PasaExµr | សំណួរ និងចម្លើយ អំពី ភាសាខ្មែរ |
| abc-zwsp | sYsþI.bgbðÚn | សួស្តី បងប្អូន |
| abc-zwsp | qñaM.2026.Ex.11 | ឆ្នាំ ២០២៦ ខែ ១១ |
| khek | sYs¶I bgbíèn | សួស្តី បងប្អូន |
| khek | ekµg@kMBugeronGk§rExµr enAsalaeron | ក្មេងៗកំពុងរៀនអក្សរខ្មែរ នៅសាលារៀន |
Frequently asked questions
When should I pick ABC-Zwsp for the export?
When the receiving workflow is the ABC family — pipelines, fonts or templates that expect ABC byte assignments with the Zwsp word-separator markers between words. If the document or application you are feeding was built on ABC fonts, this is the table to use; for a Limon-based print shop the Limon page is the right one instead.
Does the ABC-Zwsp output include the separator dots between words?
Yes — that is the format working as intended. ABC-Zwsp stores an explicit byte for every word boundary, which is what the target application reads as its space markers. Your normal spaces in the Unicode input are converted into those separator bytes, so the output text will show the dot-like markers between words.
What is the difference between ABC and ABC-Zwsp?
ABC-Zwsp is the ABC variant that marks word boundaries with a dedicated separator byte rather than relying on plain spaces — the "Zwsp" in the name refers to the zero-width-space convention it formalises. The glyph assignments largely match the rest of the ABC family, but a file exported without the markers will mis-segment words in software that expects them.
Can I convert a whole document to ABC-Zwsp at once?
Paste the whole text — there is no length cap. Inputs over 10 KB are converted inside a Web Worker so the page stays responsive, and the download button writes the full result as a Windows-1252 .txt file. Convert section by section only if the document mixes ABC-Zwsp with another encoding.
Data and accuracy
The three mapping tables live in lib/khmer-legacy-converter/mappings/ and are resolved from fontdata.xml in the KhmerConverter project — the open-source converter the Khmer Software Initiative (KhmerOS) has maintained since 2006 for Limon, ABC, Khek and other legacy Khmer fonts. The page converts entirely in your browser; the only promise about the output is the table itself, which is why the round-trip corpus in the same library regression-tests every shipped pair. A wrong result means the selected encoding does not match the receiving font — the fix is choosing the right table, not stale data.
Sources
- Khmer — Unicode code chart U+1780–U+17FF — Unicode Consortium
- KhmerConverter — Khmer Software Initiative legacy-font converter (fontdata.xml tables) — Khmer Software Initiative / KhmerOS (GitHub)
- This tool’s own page — InKhmer
Content last reviewed 8 November 2026