3 releases

Uses old Rust 2015

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

#1903 in Encoding

Download history 3/week @ 2024-03-21 33/week @ 2024-03-28 28/week @ 2024-04-04 2/week @ 2024-04-18 11/week @ 2024-06-20 34/week @ 2024-06-27 21/week @ 2024-07-04

66 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