String originalFileName ="한글!!! 한글!! abc#@$$";
System.out.println("====org=====");
System.out.println(originalFileName);
System.out.println("====8859-1=====");
System.out.println(new String( originalFileName.getBytes( "8859_1"), "KSC5601"));
System.out.println(new String( originalFileName.getBytes( "8859_1"), "EUC-KR"));
System.out.println(new String( originalFileName.getBytes( "8859_1"), "UTF-8"));
System.out.println("====KSC5601=====");
System.out.println(new String( originalFileName.getBytes( "KSC5601"), "8859_1"));
System.out.println(new String( originalFileName.getBytes( "KSC5601"), "EUC-KR"));
System.out.println(new String( originalFileName.getBytes( "KSC5601"), "UTF-8"));
System.out.println("====EUC-KR=====");
System.out.println(new String( originalFileName.getBytes( "EUC-KR"), "8859_1"));
System.out.println(new String( originalFileName.getBytes( "EUC-KR"), "KSC5601"));
System.out.println(new String( originalFileName.getBytes( "EUC-KR"), "UTF-8"));
System.out.println("====UTF-8=====");
System.out.println(new String( originalFileName.getBytes( "UTF-8"), "KSC5601"));
System.out.println(new String( originalFileName.getBytes( "UTF-8"), "8859_1"));
System.out.println(new String( originalFileName.getBytes( "UTF-8"), "EUC-KR"));


시스템에 맞는 인코딩이 뭔지 모르겠을 때... 이렇게 테스트라도 해보자.

[출처]http://suya55.tistory.com/314
Posted by lI헐헐Il
,