3 releases

Uses old Rust 2015

0.1.2 Nov 22, 2017
0.1.1 Nov 22, 2017
0.1.0 Nov 22, 2017

#1970 in Encoding

Download history 1/week @ 2024-07-29 10/week @ 2024-08-19 53/week @ 2024-08-26 34/week @ 2024-09-02 59/week @ 2024-09-09 10/week @ 2024-09-16 43/week @ 2024-09-23 31/week @ 2024-09-30 37/week @ 2024-10-07 29/week @ 2024-10-14 23/week @ 2024-10-21 18/week @ 2024-10-28 16/week @ 2024-11-04

87 downloads per month

MIT/Apache

15KB
647 lines

#ebcdic-rs

It provides methods to convert ebcsic to ascii and back.

extern crate ebcdic;
use std::str;
use ebcdic::Ebcdic;
fn main() {
    let ascii_str = "       IDENTIFICATION DIVISION.                                         00000010";
    let mut ebcdic_bytes: [u8; 80] = [0; 80];
    Ebcdic::ascii_to_ebcdic(ascii_str.as_bytes(), &mut ebcdic_bytes, 80, true);
    let mut ascii_str_2: [u8; 80] = [0; 80];
    Ebcdic::ebcdic_to_ascii(&ebcdic_bytes, &mut ascii_str_2, 80, false, true);
    assert_eq!(ascii_str, str::from_utf8(&ascii_str_2).unwrap());
}

No runtime deps