飙血推荐
  • HTML教程
  • MySQL教程
  • JavaScript基础教程
  • php入门教程
  • JavaScript正则表达式运用
  • Excel函数教程
  • UEditor使用文档
  • AngularJS教程
  • ThinkPHP5.0教程

unicode转ascii java

时间:2021-11-10  作者:匿名  

好像百度到一个有问题

只能解析一半

这个可以用

private static String ascii2native ( String asciicode )
    {
        String[] asciis = 域名t ("\\\\\\\\u");
        String nativeValue = asciis[0];
        try
        {
            for ( int i = 1; i < 域名th; i++ )
            {
                String code = asciis[i];
                nativeValue += (char) 域名eInt (域名tring (0, 4), 16);
                if (域名th () > 4)
                {
                    nativeValue += 域名tring (4, 域名th ());
                }
            }
        }
        catch (NumberFormatException e)
        {
            return asciicode;
        }
        return nativeValue;
    }
标签:unicodeascii
湘ICP备14001474号-3  投诉建议:234161800@qq.com   部分内容来源于网络,如有侵权,请联系删除。