java - how decode ascii code from json -


i received json file ascii code in middle, example:

âmbito da comemoração dia de são valentim, 14 de fevereiro.

how decode special chars in java.

thanks you.

that "âmbito da comemoração dia de são valentim, 14 de fevereiro."

    string s = "âmbito da comemoração dia de são valentim, 14 de fevereiro.";     pattern p = pattern.compile("&#(\\d+);|.");     stringbuilder sb = new stringbuilder();     matcher m  = p.matcher(s);     while (m.find())         if (m.group(1) != null)             sb.append((char)integer.parseint(m.group(1)));         else             sb.append(m.group());     system.out.println(sb.tostring());     // -> âmbito da comemoração dia de são valentim, 14 de fevereiro. 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -