|
@@ -1,6 +1,7 @@
|
|
|
package com.artncore.wallpadimap;
|
|
|
|
|
|
import android.content.Context;
|
|
|
+import android.os.Build;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Looper;
|
|
|
import android.os.Message;
|
|
@@ -23,6 +24,7 @@ import java.io.InputStream;
|
|
|
import java.io.InputStreamReader;
|
|
|
import java.net.InetSocketAddress;
|
|
|
import java.net.Socket;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
|
|
|
import javax.xml.parsers.DocumentBuilder;
|
|
|
import javax.xml.parsers.DocumentBuilderFactory;
|
|
@@ -450,7 +452,22 @@ public class WallPadiMAPClient {
|
|
|
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
|
|
DocumentBuilder builder = factory.newDocumentBuilder();
|
|
|
iMapXML = XMLDoc;
|
|
|
- InputStream istream = new ByteArrayInputStream(iMapXML.getBytes());
|
|
|
+
|
|
|
+ //여기서 utf-16 구분 필요
|
|
|
+ //2024.10.24 jglee utf-16 처리 추가
|
|
|
+ boolean isutf16 = iMapXML.toLowerCase().contains("utf-16");
|
|
|
+ byte[] inputdata = null;
|
|
|
+ if(isutf16)
|
|
|
+ {
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
+ inputdata = iMapXML.getBytes(StandardCharsets.UTF_16);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ inputdata = iMapXML.getBytes();
|
|
|
+ }
|
|
|
+ InputStream istream = new ByteArrayInputStream(inputdata);
|
|
|
doc = builder.parse(istream);
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|