diff --git a/mica-ip2region/src/main/java/net/dreamlu/mica/ip2region/core/Searcher.java b/mica-ip2region/src/main/java/net/dreamlu/mica/ip2region/core/Searcher.java index c7cec6aa0d13fa4db07e43babd5d37c481d3437d..a6c6e7f7d64f1a6cb7066e526cf00c747030a524 100644 --- a/mica-ip2region/src/main/java/net/dreamlu/mica/ip2region/core/Searcher.java +++ b/mica-ip2region/src/main/java/net/dreamlu/mica/ip2region/core/Searcher.java @@ -6,6 +6,7 @@ package net.dreamlu.mica.ip2region.core; import java.io.IOException; import java.io.RandomAccessFile; +import java.nio.charset.StandardCharsets; /** * xdb searcher (Not thread safe implementation) @@ -128,7 +129,7 @@ public class Searcher { // load and return the region data final byte[] regionBuff = new byte[dataLen]; read(dataPtr, regionBuff); - return new String(regionBuff); + return new String(regionBuff, StandardCharsets.UTF_8); } protected void read(int offset, byte[] buffer) throws IOException {