달력

7

« 2025/7 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

 입력: &#00C0;&#00C1&#00C2

출력: #00C0#00C1#00C2

private String convertUnicode(String src){
  char[] temp=src.toCharArray();  
  StringBuffer result=new StringBuffer(temp.length);  
  for(int i=0;i<temp.length;i++){
   if(temp[i]=='&' && temp.length>i+7 && temp[i+1]=='#' && temp[i+7]==';'){
    try{
     result.append((char)Integer.parseInt(src.substring(i+2, i+7)));
     i=i+7;
    }catch(NumberFormatException e){
     result.append(temp[i]);
    }    
   }
   else
    result.append(temp[i]);
  }
  result.trimToSize();
  return result.toString();
 }


출처 : http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040201&docId=108791164&qb=7ZWc6riA7J2EIOycoOuLiOy9lOuTnOuhnA==&enc=utf8&section=kin&rank=3&search_sort=0&spq=0&pid=gh1yhdoi5T0ssu5wdJwsss--450806&sid=TY0owDMfjU0AABk8JDo
:
Posted by 상문이