Skip to content

Repository files navigation

InPage ↔ Unicode Urdu Converter

License: GPL v3 Python 3.8+ Platform: Windows GitHub Release GitHub Downloads

Convert old InPage Urdu documents into modern Unicode text — works fully offline, no internet required, and no data ever leaves your computer.

For developers and advanced users, the application is built in Python and PyQt5 to provide bidirectional conversion between InPage's legacy glyph encoding (CP-1252/custom) and standard Unicode. This paste-based text utility bypasses the need to parse binary .inp files, designed to easily migrate text databases between legacy print layouts and modern web formats.

InPage ↔ Unicode Urdu Converter Screenshot


🎯 Who is this for?

  • Urdu Publishers & Typesetters: Digitizing old InPage books and newspapers into modern digital formats.
  • Students & Researchers: Converting legacy InPage thesis files and documents to edit them in modern tools.
  • IT Administrators: Migrating legacy office archives to modern content management systems.
  • Everyday Users: Anyone who has legacy .inp-era copied or pasted text that renders as gibberish (e.g., CP-1252 character maps) in Microsoft Word or web browsers.

📥 Download


🚀 Key Features

  • Bidirectional Conversion: Seamlessly switch between InPage → Unicode and Unicode → InPage modes.
  • Raw Clipboard Bypass: Implements native Windows ctypes clipboard integration to directly read raw CF_TEXT bytes, bypassing lossy Windows ANSI/Unicode conversions that strip critical character markers (such as non-breaking spaces \xa0 representing Noon).
  • Offline-First & Private: Operates 100% locally with zero external network requests, telemetry, or third-party API dependencies.
  • Nastaliq Rendering: Bundles Google's Noto Nastaliq Urdu font and configures native Right-to-Left (RTL) reading layout for Unicode output, guaranteeing proper rendering across systems.
  • Text Formatting & Punctuation Options:
    • Remove Double Spaces: Collapses multiple consecutive spaces into a single space (remove_double_space).
    • Word Spacing Adjustment: Automatically adds space after every word for custom typesetting (add_word_space).
    • Comma & Number Spacing: Auto-inserts spaces after commas (, and ،) and numeric runs (digits) (add_comma_number_space).
  • Smart Linguistic Processing: Handles complex Urdu orthography rules including Heh-Hamza combinations (ۂ), diacritics residing between base letters and modifiers, Bari Yee contextual forms, digit direction reversal (LTR), and quotation mark handling.
  • Direct File Export: Option to save converted output directly to .txt files with appropriate UTF-8 (Unicode) or CP-1252 (legacy InPage ANSI) encodings.
  • Live Statistics & Validation: Real-time input character count, empty input protection, and heuristic direction checking.

📂 Repository Structure

InPageToUnicode/
├── assets/                  # Application icon and bundled Noto Nastaliq font
├── mapping/                 # Bidirectional glyph mapping tables and core conversion rules
│   └── glyph_map.py
├── src/                     # PyQt5 application GUI and raw Windows clipboard integration
│   ├── main.py              # Application entry point
│   ├── main_window.py       # GUI layout, controls, and event handlers
│   └── clipboard.py         # Win32 ctypes raw clipboard API wrapper
├── tests/                   # Automated unit and GUI integration test suite
│   ├── test_gui.py          # PyQt5 GUI interaction tests
│   └── test_pairs.py        # Mapping correctness and linguistic edge-case tests
├── InPageConverter.spec     # PyInstaller single-executable build specification
├── inno_setup.iss           # Inno Setup 6 installer creation script
├── CODE_DOCUMENTATION.md    # Engineering architecture & module specification
├── DESIGN_PHILOSOPHY.md     # Architectural trade-offs and design rationale
├── RELEASE_NOTES.md         # Full changelog and release history
└── README.md                # Project landing page and user guide

🛠️ Developer Setup & Installation

Prerequisites

  • Python 3.8+
  • Windows OS (required for ctypes raw clipboard handling and packaging)

Installation

  1. Clone the repository:

    git clone https://github.com/salmanasmat/InPageToUnicode.git
    cd InPageToUnicode
  2. Create and activate a virtual environment:

    python -m venv .venv
    .\.venv\Scripts\Activate.ps1
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the application:

    python src/main.py

🧪 Running Unit Tests

The codebase includes comprehensive unit and GUI integration tests covering mapping accuracy, digits reversal, Hamza correction, quotation rules, spacing options, and clipboard handling.

To execute the full test suite:

python -m unittest discover -s tests

📦 Build & Packaging Instructions

Standalone Executable (.exe)

The application can be compiled into a single executable using PyInstaller. A spec file is provided:

pyinstaller InPageConverter.spec

The compiled executable will be generated inside the dist/ directory with all bundled assets (icon, Noto Nastaliq font, mapping module).

Windows Installer

An Inno Setup script (inno_setup.iss) is included to generate a standalone Windows installer:

  1. Ensure Inno Setup 6 is installed on your system.
  2. Compile the installer:
    ISCC.exe inno_setup.iss

The installer executable (InPageUnicodeConverter-Setup-1.1.2.exe) will be generated inside the installer-output/ directory.


📚 Documentation & Resources


⚠️ Known Limitations

  • Text-only Conversion: This application processes plain text only. InPage layout formatting (bold, italics, custom font sizes, text boxes, tables, multi-column pages, and images) is not preserved.
  • Encoding Dependability: Accuracy relies on standard InPage glyph mapping conventions. Non-standard font maps or heavily corrupted legacy files may require manual review.

📄 License

This project is licensed under the GNU General Public License v3 (GPL v3). See the LICENSE file for the full text.

Copyright (C) 2026 Salman Asmat

About

A lightweight, offline-first Windows desktop application built in Python and PyQt5 to convert Urdu text bidirectionally between InPage's legacy glyph encoding (CP-1252/custom) and standard Unicode.

Resources

Code of conduct

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages