Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

HebEncodingFixLite

A lightweight C# utility for fixing Hebrew text encoding issues in files.

Overview

HebEncodingFixLite is a command-line tool designed to detect and correct Hebrew text encoding problems. It helps resolve common issues where Hebrew text appears garbled or unreadable due to incorrect character encoding, such as when text encoded in Windows-1255 is misinterpreted as UTF-8 or vice versa.

Features

  • Automatic Encoding Detection: Identifies the current encoding of Hebrew text in files
  • Encoding Conversion: Converts text between different encodings (Windows-1255, ISO-8859-8, UTF-8)
  • Batch Processing: Process multiple files at once
  • Lightweight: Minimal dependencies, fast execution
  • Simple CLI: Easy-to-use command-line interface

Common Hebrew Encoding Problems

Hebrew text encoding issues typically occur when:

  • Files created in older Windows applications (using Windows-1255) are opened in modern UTF-8 systems
  • Text is copied between applications with different default encodings
  • Web content is displayed with incorrect character set declarations
  • Legacy systems export data in non-Unicode formats

Requirements

  • .NET Framework 4.5+ or .NET Core 3.1+
  • Windows, Linux, or macOS

Installation

From Source

git clone https://github.com/ori-halevi/HebEncodingFixLite.git
cd HebEncodingFixLite
dotnet build

Binary Release

Download the pre-built executable from the Releases page:

  1. Download HebEncodingFixLite.exe
  2. No installation required - just run the executable directly
  3. Optionally, add the executable to your PATH for easy access from anywhere

Usage

Basic Syntax

HebEncodingFixLite <input-file> [options]

Examples

Convert a single file from Windows-1255 to UTF-8:

HebEncodingFixLite input.txt --from windows-1255 --to utf-8

Process all text files in a directory:

HebEncodingFixLite *.txt --from windows-1255 --to utf-8

Auto-detect encoding and convert to UTF-8:

HebEncodingFixLite input.txt --auto-detect --to utf-8

Command-Line Options

Option Description
--from <encoding> Source encoding (windows-1255, iso-8859-8, utf-8)
--to <encoding> Target encoding (default: utf-8)
--auto-detect Automatically detect source encoding
--output <path> Output file path (default: overwrites input)
--backup Create backup before modifying files
--recursive Process subdirectories
--help Display help information

Supported Encodings

  • UTF-8: Universal encoding, recommended for modern applications
  • Windows-1255: Hebrew encoding used in Windows systems
  • ISO-8859-8: Hebrew encoding standard
  • CP862: DOS Hebrew encoding (if supported)

How It Works

  1. Detection Phase: The tool analyzes the byte patterns in the file to identify Hebrew text and its likely encoding
  2. Validation: Confirms the detected encoding produces valid Hebrew characters
  3. Conversion: Transcodes the text from the source encoding to the target encoding
  4. Output: Writes the corrected text to the specified output location

Examples of Fixed Text

Before (garbled):

ùìåí òåìí

After (corrected):

שלום עולם

Common Issues

Issue: Text still appears garbled after conversion

Solution: Try using the --auto-detect flag or manually specify a different source encoding.

Issue: Program doesn't detect Hebrew text

Solution: Ensure the file contains valid Hebrew characters and is not binary or encrypted.

Issue: Backup files accumulate

Solution: Use the --backup flag only when needed, or clean up .bak files periodically.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Ori Halevi

Acknowledgments

  • Inspired by common Hebrew encoding issues in legacy systems
  • Built to help preserve Hebrew digital content
  • Thanks to the .NET community for encoding libraries

Related Projects

Support

If you encounter any issues or have questions, please open an issue on GitHub.


Note: Always backup important files before running encoding conversion tools.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages