Commit 150d23f2 authored by captainwong's avatar captainwong

fix 2

parent 158ce1b3
...@@ -24,12 +24,12 @@ public class SimpleServer { ...@@ -24,12 +24,12 @@ public class SimpleServer {
String HEX_STRING = "0123456789ABCDEF"; String HEX_STRING = "0123456789ABCDEF";
String s = ""; String s = "";
for(int i = 0; i < b.length; i++){ for(int i = 0; i < b.length; i++){
byte c = b[i]; char c = b[i];
if(32 <= c && c <= 127){ if(32 <= c && c <= 127){
s += (char)c; s += (char)c;
}else{ }else{
s += "\\x" + HEX_STRING.charAt(b[i] >>> 4); s += "\\x" + HEX_STRING.charAt((byte)c >>> 4);
s += HEX_STRING.charAt(b[i] & 0x0F); s += HEX_STRING.charAt(c & 0x0F);
} }
} }
return s; return s;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment