File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/java/qiniu/ip17mon Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 66import java .io .InputStream ;
77import java .net .HttpURLConnection ;
88import java .net .URL ;
9+ import java .nio .charset .Charset ;
910import java .util .InputMismatchException ;
1011
1112public final class Locator implements ILocator {
12- public static final String VERSION = "0.0.2" ;
13+ public static final String VERSION = "0.1" ;
14+ private static final Charset Utf8 = Charset .forName ("UTF-8" );
1315 private final byte [] ipData ;
1416 private final int textOffset ;
1517 private final int [] index ;
@@ -82,8 +84,8 @@ static byte[] textToNumericFormatV4(String str) {
8284 }
8385
8486 static LocationInfo buildInfo (byte [] bytes , int offset , int len ) {
85- String str = new String (bytes , offset , len );
86- String [] ss = str .split ("\t " );
87+ String str = new String (bytes , offset , len , Utf8 );
88+ String [] ss = str .split ("\t " , - 1 );
8789 if (ss .length == 4 ) {
8890 return new LocationInfo (ss [0 ], ss [1 ], ss [2 ], "" );
8991 } else if (ss .length == 5 ) {
You can’t perform that action at this time.
0 commit comments