private String codeChar(char[] chars){
  String toReturn="";
  int i;
  for (i=0; i < chars.length; i++) {
switch (chars[i]) {
case ' ':
      toReturn+="20";
    break;
case '!':
  toReturn+="a1";
break;
case '"':
toReturn+="a2";
break;
case '#':
toReturn+="23";
break;
case '$':
toReturn+="a4";
break;
case '%':
toReturn+="25";
break;
case '&':
toReturn+="26";
break;
case '\'':
toReturn+="a7";
break;
case '(':
toReturn+="a8";
break;
case ')':
toReturn+="29";
break;
case 'á':
toReturn+="2a";
break;
case '+':
toReturn+="ab";
break;
case ',':
toReturn+="2c";
break;
case '-':
toReturn+="ad";
break;
case '.':
toReturn+="ae";
break;
case '/':
toReturn+="2f";
break;
case '0':
toReturn+="b0";
break;
case '1':
toReturn+="31";
break;
case '2':
toReturn+="32";
break;
case '3':
toReturn+="b3";
break;
case '4':
toReturn+="34";
break;
case '5':
toReturn+="b5";
break;
case '6':
toReturn+="b6";
break;
case '7':
toReturn+="37";
break;
case '8':
toReturn+="38";
break;
case '9':
toReturn+="b9";
break;
case ':':
toReturn+="ba";
break;
case ';':
toReturn+="3b";
break;
case '<':
toReturn+="bc";
break;
case '=':
toReturn+="3d";
break;
case '>':
toReturn+="3e";
break;
case '?':
toReturn+="bf";
break;
case '@':
toReturn+="40";
break;
case 'A':
toReturn+="c1";
break;
case 'B':
toReturn+="c2";
break;
case 'C':
toReturn+="43";
break;
case 'D':
toReturn+="c4";
break;
case 'E':
toReturn+="45";
break;
case 'F':
toReturn+="46";
break;
case 'G':
toReturn+="c7";
break;
case 'H':
toReturn+="c8";
break;
case 'I':
toReturn+="49";
break;
case 'J':
toReturn+="4a";
break;
case 'K':
toReturn+="cb";
break;
case 'L':
toReturn+="4c";
break;
case 'M':
toReturn+="cd";
break;
case 'N':
toReturn+="ce";
break;
case 'O':
toReturn+="4f";
break;
case 'P':
toReturn+="d0";
break;
case 'Q':
toReturn+="51";
break;
case 'R':
toReturn+="52";
break;
case 'S':
toReturn+="d3";
break;
case 'T':
toReturn+="54";
break;
case 'U':
toReturn+="d5";
break;
case 'V':
toReturn+="d6";
break;
case 'W':
toReturn+="57";
break;
case 'X':
toReturn+="58";
break;
case 'Y':
toReturn+="d9";
break;
case 'Z':
toReturn+="da";
break;
case '[':
toReturn+="5b";
break;
case 'é':
toReturn+="dc";
break;
case ']':
toReturn+="5d";
break;
case 'í':
toReturn+="5e";
break;
case 'ó':
toReturn+="df";
break;
case 'ú':
toReturn+="e0";
break;
case 'a':
toReturn+="61";
break;
case 'b':
toReturn+="62";
break;
case 'c':
toReturn+="e3";
break;
case 'd':
toReturn+="64";
break;
case 'e':
toReturn+="e5";
break;
case 'f':
toReturn+="e6";
break;
case 'g':
toReturn+="67";
break;
case 'h':
toReturn+="68";
break;
case 'i':
toReturn+="e9";
break;
case 'j':
toReturn+="ea";
break;
case 'k':
toReturn+="6b";
break;
case 'l':
toReturn+="ec";
break;
case 'm':
toReturn+="6d";
break;
case 'n':
toReturn+="6e";
break;
case 'o':
toReturn+="ef";
break;
case 'p':
toReturn+="70";
break;
case 'q':
toReturn+="f1";
break;
case 'r':
toReturn+="f2";
break;
case 's':
toReturn+="73";
break;
case 't':
toReturn+="f4";
break;
case 'u':
toReturn+="75";
break;
case 'v':
toReturn+="76";
break;
case 'w':
toReturn+="f7";
break;
case 'x':
toReturn+="f8";
break;
case 'y':
toReturn+="79";
break;
case 'z':
toReturn+="7a";
break;
case 'ç':
toReturn+="fb";
break;
case '÷':
toReturn+="7c";
break;
case 'Ñ':
toReturn+="fd";
break;
case 'ñ':
toReturn+="fe";
break;
case '|':
toReturn+="7f";
break;
default :
toReturn+="7f";
break;
}
if (i % 2 == 1) toReturn+=" ";
}
if (i % 2 == 1) toReturn+="80 ";
return toReturn;
}

private String codeChar ( char [ ] chars ) { String toReturn = "" ; int i ; for ( i = 0 ; i < chars . length ; i ++ ) { switch ( chars [ i ] ) { case ' ' : toReturn += "20" ; break ; case '!' : toReturn += "a1" ; break ; case '"' : toReturn += "a2" ; break ; case '#' : toReturn += "23" ; break ; case '$' : toReturn += "a4" ; break ; case '%' : toReturn += "25" ; break ; case '&' : toReturn += "26" ; break ; case '\'' : toReturn += "a7" ; break ; case '(' : toReturn += "a8" ; break ; case ')' : toReturn += "29" ; break ; case 'á' : toReturn += "2a" ; break ; case '+' : toReturn += "ab" ; break ; case ',' : toReturn += "2c" ; break ; case '-' : toReturn += "ad" ; break ; case '.' : toReturn += "ae" ; break ; case '/' : toReturn += "2f" ; break ; case '0' : toReturn += "b0" ; break ; case '1' : toReturn += "31" ; break ; case '2' : toReturn += "32" ; break ; case '3' : toReturn += "b3" ; break ; case '4' : toReturn += "34" ; break ; case '5' : toReturn += "b5" ; break ; case '6' : toReturn += "b6" ; break ; case '7' : toReturn += "37" ; break ; case '8' : toReturn += "38" ; break ; case '9' : toReturn += "b9" ; break ; case ':' : toReturn += "ba" ; break ; case ';' : toReturn += "3b" ; break ; case '<' : toReturn += "bc" ; break ; case '=' : toReturn += "3d" ; break ; case '>' : toReturn += "3e" ; break ; case '?' : toReturn += "bf" ; break ; case '@' : toReturn += "40" ; break ; case 'A' : toReturn += "c1" ; break ; case 'B' : toReturn += "c2" ; break ; case 'C' : toReturn += "43" ; break ; case 'D' : toReturn += "c4" ; break ; case 'E' : toReturn += "45" ; break ; case 'F' : toReturn += "46" ; break ; case 'G' : toReturn += "c7" ; break ; case 'H' : toReturn += "c8" ; break ; case 'I' : toReturn += "49" ; break ; case 'J' : toReturn += "4a" ; break ; case 'K' : toReturn += "cb" ; break ; case 'L' : toReturn += "4c" ; break ; case 'M' : toReturn += "cd" ; break ; case 'N' : toReturn += "ce" ; break ; case 'O' : toReturn += "4f" ; break ; case 'P' : toReturn += "d0" ; break ; case 'Q' : toReturn += "51" ; break ; case 'R' : toReturn += "52" ; break ; case 'S' : toReturn += "d3" ; break ; case 'T' : toReturn += "54" ; break ; case 'U' : toReturn += "d5" ; break ; case 'V' : toReturn += "d6" ; break ; case 'W' : toReturn += "57" ; break ; case 'X' : toReturn += "58" ; break ; case 'Y' : toReturn += "d9" ; break ; case 'Z' : toReturn += "da" ; break ; case '[' : toReturn += "5b" ; break ; case 'é' : toReturn += "dc" ; break ; case ']' : toReturn += "5d" ; break ; case 'í' : toReturn += "5e" ; break ; case 'ó' : toReturn += "df" ; break ; case 'ú' : toReturn += "e0" ; break ; case 'a' : toReturn += "61" ; break ; case 'b' : toReturn += "62" ; break ; case 'c' : toReturn += "e3" ; break ; case 'd' : toReturn += "64" ; break ; case 'e' : toReturn += "e5" ; break ; case 'f' : toReturn += "e6" ; break ; case 'g' : toReturn += "67" ; break ; case 'h' : toReturn += "68" ; break ; case 'i' : toReturn += "e9" ; break ; case 'j' : toReturn += "ea" ; break ; case 'k' : toReturn += "6b" ; break ; case 'l' : toReturn += "ec" ; break ; case 'm' : toReturn += "6d" ; break ; case 'n' : toReturn += "6e" ; break ; case 'o' : toReturn += "ef" ; break ; case 'p' : toReturn += "70" ; break ; case 'q' : toReturn += "f1" ; break ; case 'r' : toReturn += "f2" ; break ; case 's' : toReturn += "73" ; break ; case 't' : toReturn += "f4" ; break ; case 'u' : toReturn += "75" ; break ; case 'v' : toReturn += "76" ; break ; case 'w' : toReturn += "f7" ; break ; case 'x' : toReturn += "f8" ; break ; case 'y' : toReturn += "79" ; break ; case 'z' : toReturn += "7a" ; break ; case 'ç' : toReturn += "fb" ; break ; case '÷' : toReturn += "7c" ; break ; case 'Ñ' : toReturn += "fd" ; break ; case 'ñ' : toReturn += "fe" ; break ; case '|' : toReturn += "7f" ; break ; default : toReturn += "7f" ; break ; } if ( i % 2 == 1 ) toReturn += " " ; } if ( i % 2 == 1 ) toReturn += "80 " ; return toReturn ; }
incomplete method , does not consider special or extended chars
