encode-ITA_  2
string->ita_  2
encode-ITA_  2
8.12

encode-ITA_2🔗ℹ

lazerbeak12345

 (require encode-ITA_2) package: encode-ITA_2

Be aware if you site this that I used Wikipedia as my source 😅. (The only thing I sourced was the table from characters to values)

Encodes strings in the 5 bit ITA2 character encoding.

ITA2 is a modification to Baudot Code.

I made this library because I needed a character encoding as small as possible, and I didn’t want to design my own. UTF-8 is 8 byes wide and Ascii is 7 bits. Shaving an extra two bits was (at the time) desireable. I’ve heard rumors of an official UTF-4 (designed for 4 bit computers, perhaps not unlike the Intel 4004), but I haven’t been able to find a spec for this format. If you do find it anywhere, I’d love to write the library for that.

Works out of the box with ‘typed/racket‘

procedure

(string->ita_2 input)  (listof exact-nonnegative-integer?)

  input : string?
Converts input into a list of numbers representing the encoding of your text as ITA_2 format.

Be aware that the length of the returned list is usually going to be longer than the number of chars represented. That’s because, like in Unicode, control codes indicate which bank of characters are being addressed.

The returned numbers range from 0 to 31. This makes ITA_2 a 5 bit system.

input may only be composed of characters within this set:

Just be aware: ITA and its dereviatives are not compatible with Ascii or any Unicode.

procedure

(encode-ITA_2 input)  (listof exact-nonnegative-integer?)

  input : string?
An alias to string->ita_2 (see above).