한글 인코딩 오류 수정
This commit is contained in:
+12
-10
@@ -455,19 +455,19 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
logger.info("========================================");
|
||||
// ===== 인코딩 확인 로그 끝 =====
|
||||
|
||||
param.put("recvData", new String(arg));
|
||||
param.put("recvData", new String(arg, "EUC-KR"));
|
||||
} catch(Exception e) {
|
||||
logger.error("MessageSync.err - don't read the XML File - " + new String(arg), e);
|
||||
logger.error("MessageSync.err - don't read the XML File - " + new String(arg, "EUC-KR"), e);
|
||||
param.put("recvData", "");
|
||||
}
|
||||
|
||||
// byte[]로부터 XML 파싱 (BOM 제거)
|
||||
String xmlContent = new String(arg).trim();
|
||||
// byte[]로부터 XML 파싱 (BOM 제거) - EUC-KR로 읽기
|
||||
String xmlContent = new String(arg, "EUC-KR").trim();
|
||||
// BOM 제거 (UTF-8 BOM: EF BB BF)
|
||||
if (xmlContent.startsWith("\uFEFF")) {
|
||||
xmlContent = xmlContent.substring(1);
|
||||
}
|
||||
Document doc = builder.build(new ByteArrayInputStream(xmlContent.getBytes()));
|
||||
Document doc = builder.build(new ByteArrayInputStream(xmlContent.getBytes("EUC-KR")));
|
||||
|
||||
param.put("logPrcssSeqno", UUIDGenerator.getUUID());
|
||||
// xml 1.1
|
||||
@@ -624,8 +624,9 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
|
||||
ServletOutputStream sos = null;
|
||||
try {
|
||||
response.setContentType("application/xml; charset=EUC-KR");
|
||||
sos = response.getOutputStream();
|
||||
sos.write(resultS.getBytes());
|
||||
sos.write(resultS.getBytes("EUC-KR"));
|
||||
} catch( Exception e ) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
@@ -665,7 +666,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
// // 요청 전문
|
||||
sis = request.getInputStream();
|
||||
|
||||
JSONObject json = (JSONObject) JSONValue.parse(new InputStreamReader(sis));
|
||||
JSONObject json = (JSONObject) JSONValue.parse(new InputStreamReader(sis, "EUC-KR"));
|
||||
|
||||
// JJB 향후제거 shkim 2020-05-13 연계 테스트 체크
|
||||
logger.error("\n\n MMI SYNC Request : " + json.toString());
|
||||
@@ -681,9 +682,9 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
resultSet = sis.readLine(arg, total, 1024);
|
||||
}
|
||||
|
||||
param.put("recvData", new String(arg));
|
||||
param.put("recvData", new String(arg, "EUC-KR"));
|
||||
} catch(Exception e) {
|
||||
logger.error("MessageSync.err - don't read the JSON File - " + new String(arg), e);
|
||||
logger.error("MessageSync.err - don't read the JSON File - " + new String(arg, "EUC-KR"), e);
|
||||
param.put("recvData", "");
|
||||
}
|
||||
|
||||
@@ -724,8 +725,9 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
||||
|
||||
ServletOutputStream sos = null;
|
||||
try {
|
||||
response.setContentType("application/json; charset=EUC-KR");
|
||||
sos = response.getOutputStream();
|
||||
sos.write(resultS.toString().getBytes());
|
||||
sos.write(resultS.toString().getBytes("EUC-KR"));
|
||||
} catch( Exception e ) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user