Ha! I saw an episode of "Big Bang Theory" where they were arguing over the binary translation of English (how many zeros and ones there should be).
Amir had made a Decimal to Binary converter that I featured, and I mentioned that a text to binary converter would be pretty sweet.
Well now (through the magic of Small Basic) Amir CPS has made it possible to have a conversation with zeros and ones that you have encoded in binary:
Try it out here!
Get your geek on! Go translate this into English! You can double click this one line, and then copy all the text at once:
010000110110111101101101011011010110010101101110011101000010000001101111011011100010000001110100011010000110010100100000011000100110110001101111011001110010000001111001011011110111010101110010001000000110011001100001011101100110111101110010011010010111010001100101001000000110001101101111011011000110111101110010
In the tool, if your cursor gets pushed to the second line, press Delete to get it up to the top line, or else you'll get an error message. Instead of copying the full line above, you can paste in these four lines, one at a time, no spaces:
01000011011011110110110101101101011001010110111001110100001000000110111101101110001
0000001110100011010000110010100100000011000100110110001101111011001110010000001111
0010110111101110101011100100010000001100110011000010111011001101111011100100110100
10111010001100101001000000110001101101111011011000110111101110010
It's a text to binary and binary to text converter!
Import : FTK803
Small change in codes to handle "NewLine" character
Import : BTN178
And here's the code...
1.
GraphicsWindow
.
Width
=
400
2.
Height
300
3.
Title
"Text to Binary : Binary to Text"
4.
5.
TextBox
Controls
AddMultiLineTextBox
(
10
,
)
6.
SetSize
380
250
7.
ButtonTB
AddButton
"Convert to Binary"
265
8.
ButtonBT
"Convert to Text"
140
9.
ButtonClicked
onClick
10.
11.
Sub
12.
LastButton
LastClickedButton
13.
If
"Button1"
Then
14.
ConvertToBinary
15.
Else
16.
ConvertToText
17.
EndIf
18.
EndSub
19.
20.
String
GetTextBoxText
21.
For
i
1
To
Text
GetLength
22.
CharCode
GetCharacterCode
GetSubText
23.
'convert ascii codes into binary
24.
bit
""
25.
binval
26.
Count
0
27.
While
>
28.
[
]
Math
Remainder
2
29.
Floor
/
30.
+
31.
EndWhile
32.
j
Array
GetItemCount
Step
-
33.
Append
34.
EndFor
35.
'add leading zero to make binary value even
36.
b
8
37.
38.
39.
longbin
40.
41.
SetTextBoxText
42.
43.
44.
45.
Binary
46.
<
47.
ShowMessage
"Binary is un even"
"Error"
48.
49.
g
50.
Binarychar
51.
'Convert binary to decimal
52.
bit_Count
53.
binaryNum
*
Power
54.
55.
'get char from ascci code
56.
Char
GetCharacter
57.
58.
'append char
59.
LongString
60.
61.
62.
63.
64.
What do you think?
Do you need a Klingon to Binary converter? =^)
Based on the forum thread, the community added more similar converters...
Updated version from Amir:
FTK803
Version with Base-64 Conversion from WhTurner:
BTN178-0
Ternery to Text Converter from Math Man:
PWD225-1
Hex to Text Converter from Amir:
CRP718
See our forum thread conversation about this Binary converter.
Enjoy!
- Ninja Ed