Created
September 13, 2016 20:25
-
-
Save dustalov/86b26e05bb168acc524b6c4bbb100ba5 to your computer and use it in GitHub Desktop.
A brute force decoder of Cyrillic strings with unknown charset combination.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
S=$(head -1) | |
CHARSETS=(utf8 cp1251 cp1252 koi8r koi8u iso-8859-5 maccyrillic) | |
for c1 in ${CHARSETS[*]}; do | |
for c2 in ${CHARSETS[*]}; do | |
for c3 in ${CHARSETS[*]}; do | |
for c4 in ${CHARSETS[*]}; do | |
echo -ne "$c1\t$c2\t$c3\t$c4\t" | |
<<<$S iconv -f=$c1 -t=$c2 -c | iconv -f=$c3 -t=$c4 -c | |
done | |
done | |
done | |
done |
Author
dustalov
commented
Sep 21, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment