Converting Bijoy (ANSI) to/from Unicode (UTF-8) using Python

Background:

In Bangladesh, the official language of Govt. paperwork is Bangla/Bengali, and a lot of offices uses Bijoy Scripts for writing official documents in Bangla/Bengali. I was looking for an application that converts documents written in Bijoy Bangla (ANSI) to Unicode as a part of an Office automation solution. I was unable to find a good document converter. All I got text cenverters written in PHP or JS. I needed my module in python (better for running in background) so I had to write the package in python.

Task:

Convert Bijoy Bangla (ANSI) text to and from Unicode (UTF-8) text.

Environment Preperation:

  • Python 3 on Windows 10
  • Any good text editor
  • Git bash

Python Program:

The python program was structured and developed maintaiing stndards from Python.org to make package deployable in PyPi.

Right now only text conversion is been supported. I will add more functionalities as per need.

The package can be install vaia pip –

pip install bijoy2unicode

Test:

The package can be tested as –

#!/usr/bin/env python
# -*- coding: utf-8 -*-

test = converter.Unicode()
bijoy_text = 'Dfq cv‡k av‡bi kx‡l †ewóZ cvwb‡Z fvmgvb RvZxq dzj kvcjv| Zvi gv_vq cvUMv‡Qi ci¯úi mshy³ wZbwU cvZv Ges Dfh cv‡k `ywU K‡i ZviKv|'
print(bijoy_text)

toPrint=test.convertBijoyToUnicode(bijoy_text)
print(toPrint)
# উভয় পাশে ধানের শীষে বেষ্টিত পানিতে ভাসমান জাতীয় ফুল শাপলা। তার মাথায় পাটগাছের পরস্পর সংযুক্ত তিনটি পাতা এবং উভয পাশে দুটি করে তারকা।
toPrint=test.convertUnicodeToBijoy(toPrint)
print(toPrint)

Future Works:

  • Auto-detecting character encoding.
  • Convert text files.
  • Convert rtf files.
  • Convert doc/docx/pdf files.

Project URL:

https://github.com/Mad-FOX/bijoy2unicode

License:

MIT

Useful Links:

https://github.com/bahar/BijoyToUnicode

https://github.com/sh-sabbir/UnicodeToBijoy

3 comments

  1. You can convert text from Bijoy to Unicode, or Unicode to Bijoy without any specific code or software. Browse the link bellow and do the conversions online:

    https://bangla.plus/bijoy-unicode-converter/

    Like

    1. Ofcourse we can, but these tools are needed sometimes offline or integrated.

      Like

  2. Converter Web Tools (Bangla Converter) is an open source software. It is free and will be free forever. From this website you can very easily convert bijoy to unicode and unicode to bijoy. 

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

<span>%d</span> bloggers like this: