# Help! What's my encoding? ¡××­šwg¿¿uþ}0ã×/Œz0îÏ–þžwóuÜ„

I wanted to share a wonderful message with all of you lovely people on puzzling.SE, but when I typed it in, all that came out was a string of gibberish:

¡××­šwg¿¿uþ}0ã×/Œz0îÏ–þžwóuÜ„

Thankfully I've changed my keyboard now so I could write this message without any issues. The only problem is, I've forgotten what I was going to say to you all, but I know that it was really uplifting and encouraging. Can someone help me to remember what it was I wanted to say? If you can figure that out, please let me know what happened to my keyboard to make it all go so wrong!

• I'm wondering if this is a garbled URL: ¡××­šwg¿¿...https://... – r3mainer Mar 26 '15 at 11:16
• Is the message in english? – Ashutosh Nigam Mar 26 '15 at 11:54
• Yes, when it's decoded, the message is in English, and should be clear – Matt Taylor Mar 26 '15 at 11:55
• From the look of it, my first instinct is that this puzzle will be (close to) impossible for people that aren't using a Mac. – Ian MacDonald Mar 26 '15 at 12:40
• @Ian, not true at all. Ashutosh is on the right lines, and you could solve this puzzle by hand if you wanted – Matt Taylor Mar 26 '15 at 12:51

Solved it :-)

Besides Unicode, there aren't many character sets that include all of these characters. However, Windows Latin 1 seems to work. In this encoding, the puzzle text consists of the following character codes (in hexadecimal): a1 d7 d7 ad 9a 77 67 bf bf 75 fe 7d 30 e3 d7 2f 8c 7a 30 ee cf 96 fe 9e 77 f3 75 dc 84

The keyboard has two problems. The first one is that it's emitting 7 bits per character instead of 8. When the bits are reassembled in 8-bit chunks, the result is gibberish. I wrote a Python script to reassemble the original text in 7-bit chunks and ended up with Puzzling_on_stackKqGQC]OK?Sg?Mk\\B (encouraging, but still 50% garbage)

So the other problem with the keyboard appears to be a loose connection that caused one of these bits to go missing. By adding an extra 1 after bit #119, we can recover the whole message: Puzzling_on_stackexchange_is_fun!

Here's my Python script:
thex = 'a1d7d7ad9a7767bfbf75fe7d30e3d72f8c7a30eecf96fe9e77f375dc84'
tbin = ''.join(bin(int(thex[x:x+2],16))[2:].zfill(8) for x in range(0,len(thex),2))
tbin = tbin[0:119] + '1' + tbin[119:]
tplain = [chr(int(tbin[i:i+7],2)) for i in range(0,len(tbin)-1,7)]
print ''.join(tplain)

• Impressive! I wonder if there should be a tag for puzzles that involve these computery things like ASCII and Unicode, so that technogumbies like me know not to tackle them :-p – Rand al'Thor Mar 26 '15 at 13:27
• great, I tried brute force to convert in all encodings getting a few thousand of lines... but failed.... will share code anyway... – Ashutosh Nigam Mar 26 '15 at 13:29
• Wow. Didn't expect an answer that quickly! Well done =) – Matt Taylor Mar 26 '15 at 13:40
• @randal'thor Excellent suggestion. I'll start a new thread on /meta if you haven't done so already. (Edit: done) – r3mainer Mar 26 '15 at 14:01
• Just a note about the 7 bit characters: ASCII was originally a 7 bit encoding. We like to think in terms of 8 bit bytes these days, so 8 bit ASCII seems 'normal' but it's really the other way around - 8 bit ASCII is weird(and imo should never be used). – Shaz Mar 26 '15 at 17:30

I am sure it has to do with mismatched charset, soon going to put actual answer here..

UTF8 or 64 file read using ascii charset

conversion is giving:

+AKEA1wDXAK0BYQ-wg+AL8Avw-u+AP4AfQ-0+AOMA1w-/+AVI-z0+AO4AzyATAP4Bfg-w+APM-u+ANwgHg- not sure if got wrong charset or this is another puzzle...?

Second attempt:

вобябябйwgвпвпuйн}0бя/илz0йнwu MIK

using following site for conversion:

My code that did not work :(

    $str = "¡××­šwg¿¿uþ}0ã×/Œz0îÏ–þžwóuÜ„";$matchArr = array("pass","wchar","byte2be","byte2le","8bit","UCS-2","UCS-2BE","UCS-2LE","UTF-16","UTF-16BE","UTF-16LE","UTF-8","UTF-8-Mobile#DOCOMO","UTF-8-Mobile#KDDI-A","UTF-8-Mobile#KDDI-B","UTF-8-Mobile#SOFTBANK","ISO-8859-1","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","Windows-1251","CP866","KOI8-R","KOI8-U","CP850"
);

foreach($matchArr as$a){
foreach(mb_list_encodings() as $c){ //echo$a. "---".$c. "^". mb_convert_encoding($str,$a,$c)."<br/>";
echo $a. "---".$c. "===>". mb_convert_encoding($str,$c, $a)."<br/>"; } echo "-----------------------<br/>"; } /** foreach(mb_list_encodings() as$a){
foreach(mb_list_encodings() as $c){ echo mb_convert_encoding($str,$a,$c)."<br/>";
}
}
/**/

• An i-kratkoe (the backwards N with the curve above it) can only come after a vowel, so that can't be an actual Russian word. – Rand al'Thor Mar 26 '15 at 11:11