将Latin 1附加的Unicode转换为Java字符串

huangapple 未分类评论45阅读模式
英文:

Convert Latin 1 supplementary unicode to string in java

问题

Sure, here's the translated code snippet:

public static void convertUnicodeToCharacter(){
    String unicode = "\\U+00C3";
    System.out.println(StringEscapeUtils.unescapeJava(unicode));
}

And the relevant text:

我需要将 Latin 1 补充字符的 Unicode 转换为字符。

但在我的程序中,相同的 Unicode 是输出。

但是当我使用 String unicode = "\u0196"; 时,它可以正常工作。我如何解决这个问题。

英文:

I need to convert Latin 1 supplement unicodes to characters.

将Latin 1附加的Unicode转换为Java字符串

But in my program the same unicode is the output.

public static void convertUnicodeToCharacter(){
        String unicode ="\\U+00C3";
        System.out.println(StringEscapeUtils.unescapeJava(unicode));
}

But when I use the String unicode ="\u0196"; it works fine. How can I solve this.

huangapple
  • 本文由 发表于 2020年4月9日 17:38:08
  • 转载请务必保留本文链接:https://java.coder-hub.com/61118147.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定