Hebrew.EBCDIC2Unicode.Converter 2.0.0-alpha

This is a prerelease version of Hebrew.EBCDIC2Unicode.Converter.
dotnet add package Hebrew.EBCDIC2Unicode.Converter --version 2.0.0-alpha
                    
NuGet\Install-Package Hebrew.EBCDIC2Unicode.Converter -Version 2.0.0-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hebrew.EBCDIC2Unicode.Converter" Version="2.0.0-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hebrew.EBCDIC2Unicode.Converter" Version="2.0.0-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Hebrew.EBCDIC2Unicode.Converter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Hebrew.EBCDIC2Unicode.Converter --version 2.0.0-alpha
                    
#r "nuget: Hebrew.EBCDIC2Unicode.Converter, 2.0.0-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Hebrew.EBCDIC2Unicode.Converter@2.0.0-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Hebrew.EBCDIC2Unicode.Converter&version=2.0.0-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Hebrew.EBCDIC2Unicode.Converter&version=2.0.0-alpha&prerelease
                    
Install as a Cake Tool

Hebrew.EBCDIC2Unicode.Converter

NuGet Downloads License: MIT

A production-ready .NET library for converting between EBCDIC (Extended Binary Coded Decimal Interchange Code) and UTF-8 encodings, with specialized support for Hebrew text processing.

๐Ÿš€ Features

  • ๐Ÿ”„ Unified API: Single public method with clean interface
  • ๐ŸŒ Multi-Codepage Support: Hebrew Custom, IBM500, IBM037, IBM424
  • ๐Ÿ“ˆ Production Ready: Comprehensive error handling and validation
  • โšก High Performance: Optimized for large-scale text processing
  • ๐Ÿ”ง .NET 8: Built on the latest LTS framework
  • ๐Ÿ“š Well Documented: Complete XML documentation included

๐Ÿ“ฆ Installation

Package Manager Console

Install-Package Hebrew.EBCDIC2Unicode.Converter -Version 2.0.0-alpha

.NET CLI

dotnet add package Hebrew.EBCDIC2Unicode.Converter --version 2.0.0-alpha

PackageReference

<PackageReference Include="Hebrew.EBCDIC2Unicode.Converter" Version="2.0.0-alpha" />

๐Ÿ”ง Quick Start

using HebrewEBCDIC3Unicode.Converter;

// Create converter instance
var converter = new HebrewEbcdicConverter();

// Method 1: Convert EBCDIC byte array to UTF-8 (recommended)
byte[] ebcdicBytes = { 0x41, 0x42, 0x40, 0xC8, 0x85, 0x93, 0x93, 0x96 }; // ืื‘ Hello
string result = converter.ConvertEbcdicToUtf8(ebcdicBytes);
// Output: "ืื‘ Hello"

// Method 2: Convert EBCDIC string (containing raw bytes) to UTF-8
string ebcdicString = HebrewEbcdicConverter.CreateEbcdicStringFromBytes(ebcdicBytes);
string result2 = converter.ConvertEbcdicToUtf8(ebcdicString);
// Output: "ืื‘ Hello"

// Method 3: Convert hex string to UTF-8 (utility method)
string hexResult = converter.ConvertHexStringToUtf8("4142 40C8 8593 9396");
// Output: "ืื‘ Hello"

// Convert with specific codepage
string ibmResult = converter.ConvertEbcdicToUtf8(ebcdicBytes, EbcdicCodepage.IBM500);
// Output: " รข Hello"

๐Ÿ“– Supported Codepages

Codepage Description Best For
HebrewCustom Optimized Hebrew character mapping Hebrew text processing
IBM500 IBM EBCDIC International International applications
IBM037 IBM EBCDIC US-Canada North American systems
IBM424 IBM EBCDIC Hebrew IBM Hebrew systems (with .NET limitations)

๐ŸŒŸ Advanced Usage

Working with Different Input Formats

// Working with byte arrays (most efficient)
byte[] ebcdicData = GetEbcdicDataFromMainframe();
string utf8Result = converter.ConvertEbcdicToUtf8(ebcdicData);

// Working with .NET strings containing raw EBCDIC bytes
string ebcdicAsString = GetEbcdicStringFromLegacySystem();
string utf8Result2 = converter.ConvertEbcdicToUtf8(ebcdicAsString);

// Working with hex strings (for testing/debugging)
string hexString = "4142 40C8 8593 9396";
string utf8Result3 = converter.ConvertHexStringToUtf8(hexString);

Error Handling

try 
{
    byte[]? nullBytes = null;
    var result = converter.ConvertEbcdicToUtf8(nullBytes!);
}
catch (ArgumentNullException ex)
{
    // Handle null input
    Console.WriteLine($"Null input: {ex.Message}");
}

try 
{
    var result = converter.ConvertHexStringToUtf8("invalid hex");
}
catch (ArgumentException ex)
{
    // Handle invalid hex string
    Console.WriteLine($"Invalid hex: {ex.Message}");
}

Batch Processing

var ebcdicDataList = new List<byte[]> { /* your EBCDIC byte arrays */ };
var results = ebcdicDataList
    .Select(bytes => converter.ConvertEbcdicToUtf8(bytes))
    .ToList();

Round-trip Conversion

string originalText = "ืื‘ Hello 123";
byte[] ebcdicBytes = converter.ConvertFromUtf8(originalText);
string convertedBack = converter.ConvertEbcdicToUtf8(ebcdicBytes);
bool isIdentical = originalText == convertedBack; // Should be true

IBM-424 Handling

// IBM-424 has .NET limitations - graceful handling
var result = converter.ConvertEbcdicToUtf8(ebcdicBytes, EbcdicCodepage.IBM424);
// Returns: "[Codepage 424 not supported by Microsoft .NET - consider using HebrewCustom mapping]"

๐Ÿ” Character Mapping Details

Hebrew Characters (HebrewCustom)

  • Hebrew Letters (ื-ืช): Optimized mapping for modern Hebrew text
  • Final Forms: Support for final letter forms (ืš, ื, ืŸ, ืฃ, ืฅ)
  • Special Characters: Hebrew-specific punctuation and symbols

English & Numbers

  • English Letters: Standard EBCDIC uppercase/lowercase mapping
  • Numbers (0-9): Standard EBCDIC numeric mapping (0xF0-0xF9)
  • Special Characters: Spaces, periods, apostrophes, and common symbols

๐Ÿ—๏ธ Technical Implementation

Why Not System.Text.Encoding?

This library provides custom Hebrew EBCDIC mapping because:

  1. Microsoft .NET Limitations: Limited EBCDIC codepage support
  2. Hebrew Optimization: Custom mapping optimized for Hebrew text
  3. Legacy System Support: Compatibility with mainframe Hebrew data
  4. Production Reliability: Handles edge cases and invalid input gracefully
  5. Raw Byte Processing: Works directly with EBCDIC byte data, not hex representations

Performance Characteristics

  • Memory Efficient: Minimal allocations during conversion
  • Thread Safe: Converter instances can be used concurrently
  • Validation: Input validation prevents runtime errors

๐Ÿงช Testing & Quality

This library includes comprehensive testing:

  • โœ… Round-trip Testing: Ensures conversion accuracy
  • โœ… Error Handling: Invalid input validation
  • โœ… Performance Testing: Large-scale processing verification
  • โœ… Multi-codepage Testing: All supported codepages verified

๐ŸŒ Real-World Applications

  • Mainframe Data Migration: Converting legacy Hebrew EBCDIC data
  • Banking Systems: Processing Hebrew transaction data from IBM systems
  • Government Systems: Converting Hebrew administrative data
  • Database Integration: ETL processes with Hebrew EBCDIC sources

๐Ÿ“‹ Requirements

  • .NET 8.0 or later
  • System.Text.Encoding.CodePages (automatically included)

๐Ÿค Contributing

This project welcomes contributions! Areas of interest:

  • Additional EBCDIC codepage support
  • Performance optimizations
  • Enhanced Hebrew text processing
  • Documentation improvements

๐Ÿ“„ License

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

๐Ÿ“ž Support


Made with โค๏ธ for the Hebrew text processing community

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-alpha 109 7/13/2025