Office documents in Bangladesh still turn up in Bijoy / Sutonny MJ — a legacy 8-bit encoding that looks like garbage unless you have the right font installed. "Avgvi †mvbvi evsjv" is not a typo; it is "আমার সোনার বাংলা" stored as Bijoy.

Unicode is how that text should travel now: copy-paste, search, the web, phones, PDFs. But a lot of older Word files still mix Bijoy runs, Unicode Bangla, and English in the same document. A converter that blindly rewrites every run will mangle the English, or re-convert text that is already Unicode.

That is the problem I wanted to solve with bijoy2unicode.

What it is

Two pieces in one monorepo:

  1. An npm package, bijoy2unicode (TypeScript, ESM + CJS, Node 18+).
  2. A browser app at bijoy2unicode.jehadurre.me (there is also a Vercel mirror).

The package is MIT-licensed. I am Jehadur Rahman Emran; this is a personal open-source project.

I am not going to pretend the GitHub star count is the interesting number. The official npm download API reported 1,342 downloads in the 30 days from 20 October to 18 November 2026, and 352 in the week of 12–18 November. Downloads are not unique users, and I would rather people find the repo than guess from a badge. If the tool helps you, a star on GitHub is the useful signal.

A two-line start

import { convertBijoyToUnicode } from "bijoy2unicode"; convertBijoyToUnicode("Avgvi †mvbvi evsjv"); // → "আমার সোনার বাংলা" 

For Word files, import the document entry (it pulls in JSZip):

import { convertDocx, convertFile } from "bijoy2unicode/docx"; const blob = await convertDocx(file); // or let convertFile pick .docx / .odt / .rtf / .html / .txt from the extension 

convertHtml needs a browser DOMParser. On a server, extract the text and call convertBijoyToUnicode.

The part that actually matters: font inheritance

A naive converter runs on every <w:t> in the .docx. That is how English in Calibri, or Bangla that is already Unicode, gets wrecked.

bijoy2unicode walks the OOXML and resolves the effective font of each run, in this order:

  1. The run’s own <w:rFonts>
  2. The run’s character style
  3. The paragraph’s run fonts
  4. The paragraph style, following the basedOn chain
  5. The document default, <w:rPrDefault>

If the resolved font is a known Bijoy face (names ending in MJ, BijoyEkattor, Sulekha, Boishakhi, and similar), the run is converted. If it is a known Unicode Bangla face (Nikosh, SolaimanLipi, Vrinda, Noto Bengali, …), it is left alone. Ambiguous runs fall back to character heuristics: high-byte characters, Bijoy bigram density, an English-word check, vowel ratio.

You can pass { force: true } when you already know a .txt or .rtf file is Bijoy, including the awkward pure-ASCII cases that have no high-byte characters at all.

Encoding cases the library is written to handle

These are documented in the package and covered by tests; they are why I did not just wrap an older map:

  • Trailing-© reph reorder (Kg©KZ©vi → কর্মকর্তার)
  • Í (U+00CD) prefix-pair conjuncts (we¯ÍvwiZ → বিস্তারিত)
  • iæ → রু before bare æ → ু, so names like নূরুল land correctly
  • ÿ → ক্ষ
  • Precomposed nukta letters (ড়, ঢ়, য়) kept the way Word usually stores them

I built on, and corrected, earlier open-source Bijoy converters. The repo README is explicit about that inspiration.

What it does not do

  • Binary .doc (OLE) is not supported in the npm package. Convert to .docx first (LibreOffice is fine). In the web app, you may optionally paste your own CloudConvert API token; the browser talks to CloudConvert to upgrade .doc → .docx, then conversion still runs locally. Without a token, the app uses a text-only .doc fallback and will not keep tables, images, or per-run fonts.
  • The web app does not upload .docx / .odt / .rtf / .html / .txt to a bijoy2unicode server. Those paths stay in the browser.
  • This is not a font installer. After conversion, the reader still needs a Unicode Bangla font (Nikosh, SolaimanLipi, Noto Sans Bengali, …).

Why I am writing this

Low-resource scripts do not get this kind of plumbing for free. If you have a Bijoy archive, a government Word file, or a newspaper .docx that still depends on Sutonny MJ, try the live app or npm install bijoy2unicode.

Source, issues, and a place to send “this leftover character is wrong” samples: github.com/JehadurRE/Bijoy2Unicode.

If it saved you a document, a star helps the next person find it.