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
Who still needs Khek output today?
Mainly government and administrative workflows: templates authored in the Khek font, form letters printed on unreplaced institutional printers, and offices whose document systems predate Unicode. If the file you must produce is checked against a Khek template, the output must be Khek bytes — Limon or ABC-Zwsp output would print as different gibberish even inside their font.
Khek and Limon share many byte assignments — does it matter which I export?
It matters exactly where the tables differ. A file exported under the Limon table but opened in Khek will show most characters correctly with a scattering of wrong letters — the worst kind of defect, because it looks almost right. Always export under the table of the font the receiver actually has installed.
Why does my Khek file show Latin letters when I open it?
Because it is opened somewhere without the Khek font — the file correctly contains Khek byte codes, which any standard viewer renders as Latin-1 text. The check that matters is opening it inside the application that has Khek installed, where the same bytes draw Khmer. That behaviour is the whole point of a legacy encoding.
Do Khmer punctuation marks convert to Khek correctly?
The marks Khek’s table defines — including the common khan and period glyphs — convert to their assigned bytes and draw correctly in the font. Marks the font never assigned pass through unchanged and are counted in the unmapped chip, so you can spot and hand-edit the few characters a 1990s-era font could not represent.
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