亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

java unicode轉(zhuǎn)碼為中文實例

 更新時間:2013年12月19日 09:37:28   作者:  
這篇文章主要介紹了java unicode轉(zhuǎn)碼為中文的實例,大家參考使用吧

復(fù)制代碼 代碼如下:

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(); 
    } 
}

相關(guān)文章

最新評論