package com.infomorrow.parser_report;

import org.junit.Test;

public class Decode {
    @Test
    public void test(){
        String uString = "\\u9053\\u8def";
        System.out.println(ascii2native(uString));//道路
    }
    
    public static String ascii2native(String ascii) {  
        int n = ascii.length() / 6;  
        StringBuilder sb = new StringBuilder(n);  
        for (int i = 0, j = 2; i < n; i++, j += 6) {  
            String code = ascii.substring(j, j + 4);  
            char ch = (char) Integer.parseInt(code, 16);  
            sb.append(ch);  
        }  
        return sb.toString();  
    }  
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-08-27
  • 2021-08-15
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-09-02
  • 2021-09-29
  • 2022-12-23
相关资源
相似解决方案