I'm developing a socket server that will receive data from a Chinese tracking equipment, the TK-06A. So did my server that is receiving the following information:
�L�l}�8���
What do you think you can be? What enconde I use to resolve this question? Below my code I'm using to test.
public static void main(String[] args) {
try {
InputStream input = null;
int charsRead = 0;
//Criando um servidor que atendera na porta 8080
int port = 5016;
char[] inputChars = new char[1024];
ServerSocket server = new ServerSocket(port);
while (true) {
try {
System.out.println("Aguardando conexao!!!");
Socket socket = server.accept();
InputStreamReader isr = new InputStreamReader(socket.getInputStream());
BufferedReader inputStream = new BufferedReader(isr);
int data = 0;
System.out.println("Reading from stream:");
if ((charsRead = inputStream.read(inputChars)) != -1) {
System.out.println("Chars read from stream: " + charsRead);
System.out.println(inputChars);
System.out.flush();
}
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}