<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[JehadurRE's Dev Blog]]></title><description><![CDATA[JehadurRE's Dev Blog]]></description><link>https://jehadurre.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 00:35:53 GMT</lastBuildDate><atom:link href="https://jehadurre.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[I built a Bijoy Unicode converter that leaves your English (and your .docx fonts) alone]]></title><description><![CDATA[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…]]></description><link>https://jehadurre.hashnode.dev/i-built-a-bijoy-unicode-converter-that-leaves-your-english-and-your-docx-fonts-alone</link><guid isPermaLink="true">https://jehadurre.hashnode.dev/i-built-a-bijoy-unicode-converter-that-leaves-your-english-and-your-docx-fonts-alone</guid><category><![CDATA[TypeScript]]></category><category><![CDATA[open source]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[bangladesh]]></category><dc:creator><![CDATA[Jehadur Rahman Emran]]></dc:creator><pubDate>Fri, 20 Nov 2026 01:28:24 GMT</pubDate><content:encoded><![CDATA[<p>Office documents in Bangladesh still turn up in <strong>Bijoy / Sutonny MJ</strong> — 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.</p>
<p>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.</p>
<p>That is the problem I wanted to solve with <strong><a href="https://github.com/JehadurRE/Bijoy2Unicode">bijoy2unicode</a></strong>.</p>
<h2>What it is</h2>
<p>Two pieces in one monorepo:</p>
<ol>
<li>An npm package, <a href="https://www.npmjs.com/package/bijoy2unicode"><code>bijoy2unicode</code></a> (TypeScript, ESM + CJS, Node 18+).</li>
<li>A browser app at <a href="https://bijoy2unicode.jehadurre.me">bijoy2unicode.jehadurre.me</a> (there is also a Vercel mirror).</li>
</ol>
<p>The package is MIT-licensed. I am Jehadur Rahman Emran; this is a personal open-source project.</p>
<p>I am not going to pretend the GitHub star count is the interesting number. The official npm download API reported <strong>1,342 downloads in the 30 days from 20 October to 18 November 2026</strong>, and <strong>352 in the week of 12–18 November</strong>. Downloads are not unique users, and I would rather people find the repo than guess from a badge. If the tool helps you, a <a href="https://github.com/JehadurRE/Bijoy2Unicode">star on GitHub</a> is the useful signal.</p>
<h2>A two-line start</h2>
<pre><code class="language-ts">import { convertBijoyToUnicode } from "bijoy2unicode";

convertBijoyToUnicode("Avgvi †mvbvi evsjv");
// → "আমার সোনার বাংলা"
</code></pre>
<p>For Word files, import the document entry (it pulls in JSZip):</p>
<pre><code class="language-ts">import { convertDocx, convertFile } from "bijoy2unicode/docx";

const blob = await convertDocx(file);
// or let convertFile pick .docx / .odt / .rtf / .html / .txt from the extension
</code></pre>
<p><code>convertHtml</code> needs a browser <code>DOMParser</code>. On a server, extract the text and call <code>convertBijoyToUnicode</code>.</p>
<h2>The part that actually matters: font inheritance</h2>
<p>A naive converter runs on every <code>&lt;w:t&gt;</code> in the <code>.docx</code>. That is how English in Calibri, or Bangla that is already Unicode, gets wrecked.</p>
<p>bijoy2unicode walks the OOXML and resolves the <strong>effective font</strong> of each run, in this order:</p>
<ol>
<li>The run’s own <code>&lt;w:rFonts&gt;</code></li>
<li>The run’s character style</li>
<li>The paragraph’s run fonts</li>
<li>The paragraph style, following the <code>basedOn</code> chain</li>
<li>The document default, <code>&lt;w:rPrDefault&gt;</code></li>
</ol>
<p>If the resolved font is a known Bijoy face (names ending in <code>MJ</code>, 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.</p>
<p>You can pass <code>{ force: true }</code> when you already know a <code>.txt</code> or <code>.rtf</code> file is Bijoy, including the awkward pure-ASCII cases that have no high-byte characters at all.</p>
<h2>Encoding cases the library is written to handle</h2>
<p>These are documented in the package and covered by tests; they are why I did not just wrap an older map:</p>
<ul>
<li>Trailing-© reph reorder (<code>Kg©KZ©vi</code> → কর্মকর্তার)</li>
<li><code>Í</code> (U+00CD) prefix-pair conjuncts (<code>we¯ÍvwiZ</code> → বিস্তারিত)</li>
<li><code>iæ → রু</code> <em>before</em> bare <code>æ → ু</code>, so names like নূরুল land correctly</li>
<li><code>ÿ → ক্ষ</code></li>
<li>Precomposed nukta letters (ড়, ঢ়, য়) kept the way Word usually stores them</li>
</ul>
<p>I built on, and corrected, earlier open-source Bijoy converters. The repo README is explicit about that inspiration.</p>
<h2>What it does not do</h2>
<ul>
<li><strong>Binary <code>.doc</code> (OLE)</strong> is not supported in the npm package. Convert to <code>.docx</code> first (LibreOffice is fine). In the <em>web app</em>, you may optionally paste your own CloudConvert API token; the browser talks to CloudConvert to upgrade <code>.doc</code> → <code>.docx</code>, then conversion still runs locally. Without a token, the app uses a text-only <code>.doc</code> fallback and will not keep tables, images, or per-run fonts.</li>
<li>The web app does <strong>not</strong> upload <code>.docx</code> / <code>.odt</code> / <code>.rtf</code> / <code>.html</code> / <code>.txt</code> to a bijoy2unicode server. Those paths stay in the browser.</li>
<li>This is not a font installer. After conversion, the reader still needs a Unicode Bangla font (Nikosh, SolaimanLipi, Noto Sans Bengali, …).</li>
</ul>
<h2>Why I am writing this</h2>
<p>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 <code>.docx</code> that still depends on Sutonny MJ, try the <a href="https://bijoy2unicode.jehadurre.me">live app</a> or <code>npm install bijoy2unicode</code>.</p>
<p>Source, issues, and a place to send “this leftover character is wrong” samples: <a href="https://github.com/JehadurRE/Bijoy2Unicode">github.com/JehadurRE/Bijoy2Unicode</a>.</p>
<p>If it saved you a document, a star helps the next person find it.</p>
]]></content:encoded></item></channel></rss>