|
|
@ -33,11 +33,54 @@
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- adding the js converter function -->
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
var d = {
|
|
|
|
|
|
|
|
'a': 'a',
|
|
|
|
|
|
|
|
'b': 'b',
|
|
|
|
|
|
|
|
'c': 'ts',
|
|
|
|
|
|
|
|
'd': 'd',
|
|
|
|
|
|
|
|
'e': 'e',
|
|
|
|
|
|
|
|
'f': 'f',
|
|
|
|
|
|
|
|
'g': 'g',
|
|
|
|
|
|
|
|
'h': 'h',
|
|
|
|
|
|
|
|
'i': 'i',
|
|
|
|
|
|
|
|
'k': 'k',
|
|
|
|
|
|
|
|
'l': 'l',
|
|
|
|
|
|
|
|
'm': 'm',
|
|
|
|
|
|
|
|
'n': 'n',
|
|
|
|
|
|
|
|
'o': 'o',
|
|
|
|
|
|
|
|
'p': 'p',
|
|
|
|
|
|
|
|
'q': 'ya',
|
|
|
|
|
|
|
|
'r': 'r',
|
|
|
|
|
|
|
|
's': 's',
|
|
|
|
|
|
|
|
't': 't',
|
|
|
|
|
|
|
|
'u': 'u',
|
|
|
|
|
|
|
|
'v': 'dzh',
|
|
|
|
|
|
|
|
'w': 'v',
|
|
|
|
|
|
|
|
'y': 'y',
|
|
|
|
|
|
|
|
'z': 'zh',
|
|
|
|
|
|
|
|
'`': 'ch',
|
|
|
|
|
|
|
|
']': 'sht',
|
|
|
|
|
|
|
|
'[': 'sh',
|
|
|
|
|
|
|
|
'|': 'yu',
|
|
|
|
|
|
|
|
}
|
|
|
|
function convert(){
|
|
|
|
function convert(){
|
|
|
|
event.preventDefault();
|
|
|
|
event.preventDefault();
|
|
|
|
var charles = document.getElementById("input").value;
|
|
|
|
var charles = document.getElementById("input").value;
|
|
|
|
console.log(charles,charles.charCodeAt(0).toString(2),charles.charCodeAt(0).toString(16),charles.charCodeAt(0).toString(10));
|
|
|
|
var charlesBinary="";
|
|
|
|
|
|
|
|
var charlesHex="";
|
|
|
|
|
|
|
|
var charlesDc="";
|
|
|
|
|
|
|
|
var charlesCY="";
|
|
|
|
|
|
|
|
for (var i=0;i<charles.length;i++){
|
|
|
|
|
|
|
|
console.log(i,charles.charCodeAt(i));
|
|
|
|
|
|
|
|
charlesBinary=charlesBinary+charles.charCodeAt(i).toString(2);
|
|
|
|
|
|
|
|
charlesHex=charlesHex+charles.charCodeAt(i).toString(16);
|
|
|
|
|
|
|
|
charlesDc=charlesDc+charles.charCodeAt(i).toString(10);
|
|
|
|
|
|
|
|
charlesCY=charlesCY+d[charles[i]];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(charles,charlesBinary,charlesHex,charlesDc,charlesCY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
</html>
|
|
|
|
</html>
|
|
|
|