A lightweight C# utility for fixing Hebrew text encoding issues in files.
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.
- 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
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
- .NET Framework 4.5+ or .NET Core 3.1+
- Windows, Linux, or macOS
git clone https://github.com/ori-halevi/HebEncodingFixLite.git
cd HebEncodingFixLite
dotnet buildDownload the pre-built executable from the Releases page:
- Download
HebEncodingFixLite.exe - No installation required - just run the executable directly
- Optionally, add the executable to your PATH for easy access from anywhere
HebEncodingFixLite <input-file> [options]Convert a single file from Windows-1255 to UTF-8:
HebEncodingFixLite input.txt --from windows-1255 --to utf-8Process all text files in a directory:
HebEncodingFixLite *.txt --from windows-1255 --to utf-8Auto-detect encoding and convert to UTF-8:
HebEncodingFixLite input.txt --auto-detect --to utf-8| 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 |
- 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)
- Detection Phase: The tool analyzes the byte patterns in the file to identify Hebrew text and its likely encoding
- Validation: Confirms the detected encoding produces valid Hebrew characters
- Conversion: Transcodes the text from the source encoding to the target encoding
- Output: Writes the corrected text to the specified output location
Before (garbled):
ùìåí òåìí
After (corrected):
שלום עולם
Solution: Try using the --auto-detect flag or manually specify a different source encoding.
Solution: Ensure the file contains valid Hebrew characters and is not binary or encrypted.
Solution: Use the --backup flag only when needed, or clean up .bak files periodically.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Ori Halevi
- GitHub: @ori-halevi
- Inspired by common Hebrew encoding issues in legacy systems
- Built to help preserve Hebrew digital content
- Thanks to the .NET community for encoding libraries
- taskbar-color-change-by-lang - Changes taskbar color based on keyboard language
If you encounter any issues or have questions, please open an issue on GitHub.
Note: Always backup important files before running encoding conversion tools.