scene.org File Archive

File download

<root>­/­parties­/­2015­/­atparty15­/­wild/02_shortcat_encoder_decoder.zip

File size:
2 792 bytes (2.73K)
File date:
2015-06-24 05:45:02
Download count:
all-time: 64

Preview

  • shortcat_encoder_decoder.txt 969B

file_id.diz

Shortcat is a very simple encoding scheme to make bytes (thus computer programs) into pleasing Unicode tweets, IMs, etc. #demoscene

Encoder: cat x.prg | perl -pe 'binmode STDOUT,":utf8";tr/\x00-\xff/\x{2500}-\x{25ff}/;' > x.txt #demoscene

Decoder: cat x.txt | perl -pe 's/[\x00-\x7f]//g;s/\xe2(.)(.)[^\xe2]*/chr((ord($1)-148)*64+ord($2)-128)/eg;' > x.prg #demoscene

To decode, copy the Shortcat string to a new text file, save it, decode. ASCII (incl. spaces & newlines) will be ignored #demoscene

When decoding, don't include other Unicode besides the Shortcat string in your selection #demoscene

Add a hashtag (e.g., #c64) and/or other info (e.g., SYS4096) to help people run the program. That's it. Nanointros everywhere! #demoscene

For example: ━┈┋┈┊─▞┲┰┶┱───┠▁◿▎┠◐▎┡◐▽┦┈▝┇┄▩┋▝┇◘◨◠┙◐◰╠┓┈┏┒└┃━└┮┠┈┅┌┌┏┬┠─┐━┒└┙┡ #c64 RUN #demoscene