ebcdic

Crates.ioebcdic
lib.rsebcdic
version0.1.2
sourcesrc
created_at2017-11-22 17:05:39.842167
updated_at2017-11-22 17:33:48.114622
descriptionLibrary to convert EBCDIC to ASCII and back
homepagehttps://github.com/rohitjoshi/ebcdic-rs
repositoryhttps://github.com/rohitjoshi/ebcdic-rs
max_upload_size
id40246
size26,109
Rohit Joshi (rohitjoshi)

documentation

https://github.com/rohitjoshi/ebcdic-rs/blob/master/README.md

README

#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());
}
Commit count: 11

cargo fmt