중국어 문자 인코딩 정상 디버깅 코드 보이기
그 인코딩을 통해 문자를 정상적인 중국어 문자로 표시할 수 있는지 테스트할 수 있다.
public static void testCode(String text)
{
String[] srcCode={"gbk","gb2312","utf-8","iso8859-1","latin1"};
String text1;
try
{
for(int i=0;i<srcCode.length;i++)
{
text1=new String(text.getBytes(),srcCode[i]);
logger.info(srcCode[i]+":"+text1);
}
for(int i=0;i<srcCode.length;i++)
{
for(int j=0;j<srcCode.length;j++)
{
text1=new String(text.getBytes(srcCode[i]),srcCode[j]);
logger.info(srcCode[i]+","+srcCode[j]+":"+text1);
}
}
text1=java.net.URLDecoder.decode(text);
logger.info(text1);
}
catch(Exception e)
{
e.printStackTrace();
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단하게 말하자면, Scala 집합하위 패키지의 모든 정의를 포함합니다.당신이 처리할 대부분의 추상은 여기에 정의되어 있습니다.collection.concurrent매핑 피쳐와 TrieMap 클래스를 정의하려면 원자적이고 잠금 없는 액세스 작업을 사...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.