Convert legacy Bijoy / Sutonny MJ Bangla text and Word documents to Unicode Bengali.
If this converted a document you actually needed, please star this repo — it is the main way other people find the tool. Issues and awkward Bijoy
.docxsamples are also welcome.
- Live app: https://bijoy2unicode.jehadurre.me
- Mirror: https://bijoy2unicodex.vercel.app
Drag-and-drop a .docx, .odt, .rtf, .html, or .txt file. Those formats are converted in the browser; they are not uploaded to a bijoy2unicode server.
Legacy binary .doc is different: the npm package does not read .doc. In the web app, if you add your own CloudConvert API token in Settings, the file is sent from the browser to CloudConvert to be upgraded to .docx, then the Bijoy → Unicode pass still runs locally. Without a token, the app falls back to an in-browser text-only .doc path that does not keep complex formatting. The app’s FAQ notes that CloudConvert’s free plan (as documented there) covers 25 conversions per day.
| Folder | Description |
|---|---|
packages/bijoy2unicode |
The npm package — string + file conversion. ESM + CJS + TypeScript types. Node 18+. |
bijoy2unicode-app |
The live web app — Next.js, drag-and-drop UI, optional CloudConvert BYOK for .doc. |
testfiles |
Real-world .docx regression samples. |
The published package is bijoy2unicode (currently 1.0.2). Full API notes live in packages/bijoy2unicode/README.md.
npm install bijoy2unicodeRequires Node.js 18 or later. The default entry has no file I/O. Import bijoy2unicode/docx when you need documents (that path uses JSZip).
import { convertBijoyToUnicode } from "bijoy2unicode";
import { convertDocx, convertFile } from "bijoy2unicode/docx";
convertBijoyToUnicode("Avgvi †mvbvi evsjv");
// → "আমার সোনার বাংলা"
const blob = await convertDocx(file);
const result = await convertFile(file);
// result.blob, result.filenameHelpers on the default entry: looksLikeBijoy, hasBengaliUnicode, shouldConvertAsBijoy, scanUnmapped, isSuspiciousLeftover, describeCodepoint.
File helpers: convertDocx, convertOdt, convertRtf, convertHtml (browser DOMParser only), convertTxt, convertFile. Pass { force: true } to convert even when heuristics are unsure. { onProgress } reports stage and percent.
.docx conversion does not run the converter on every run blindly. It resolves the effective font of each <w:r> in this order:
- The run’s own
<w:rFonts> - The run’s character style
- The paragraph run fonts
- The paragraph style (
basedOnchain) - Document default
<w:rPrDefault>
Known Bijoy fonts (for example names ending in MJ, BijoyEkattor, Sulekha, Boishakhi) are converted. Known Unicode Bangla fonts (Nikosh, SolaimanLipi, Vrinda, Noto Bengali, and similar) are left alone. Ambiguous runs use character heuristics (high-byte characters, Bijoy bigram density, English-word lookup, vowel ratio).
English in Calibri / Times New Roman / Arial stays untouched, even inside a Bijoy-heavy document.
These are cases the library is written to handle, including some encodings other converters miss:
- Trailing-© reph reorder (
Kg©KZ©vi→ কর্মকর্তার) Í(U+00CD) prefix-pair conjuncts (we¯ÍvwiZ→ বিস্তারিত)iæ → রুordered before bareæ → ুÿ → ক্ষalternate encoding- Precomposed nukta letters (ড় / ঢ় / য়) kept as Word/Office usually stores them
- Multi-character sequences such as
Mø → গ্ল,cø → প্ল,eø → ব্ল,kø → শ্ল
- Legacy
.doc(binary OLE) is not supported in the npm package. Convert to.docxfirst (LibreOffice, or CloudConvert as in the web app). .htmlconversion needsDOMParser(browser). On a server, extract text and useconvertBijoyToUnicode.- Pure-ASCII Bijoy (
bvg wcZvi bvgwith no high-byte characters) is ambiguous in.txt/.rtf. Useforce: trueif you know it is Bijoy.
cd bijoy2unicode-app
npm run devOpen http://localhost:3000. Package tests and the publish workflow live under packages/bijoy2unicode.
Bug reports and PR with messy real-world Bijoy .docx samples help the most. The live app can report leftover unmapped characters.
Md. Jehad (Jehadur Rahman Emran) · Cloud Connect AI
- GitHub: JehadurRE
- Website: jehadurre.me
- Email: emran.jehadur@gmail.com
The TypeScript implementation builds on, and corrects, earlier open-source Bijoy converters that served as inspiration. See the package README for that note.