Character references (Entities) to UTF Characters
I am facing a character reference problem. My CKEditor converts the special characters to corresponding Entities (in CKEditor I can't change the settings.) And this looks like as under.
"Ö" => "Ö"
"ö" => "ö"
"Ä" => "Ä"
"ä" => "ä"
"Ü" => "Ü"
"ü" => "ü"
Now In my Java, PHP or Coldfusion script开发者_高级运维 I want again to replace all the Entities with special characters. Is there any method available for such replacements?
For Java, the Apache Commons StringEscapeUtils.unescapeHTML(String)
method understands all standard entity attributes in a number of versions of HTML, including the numeric ones.
By the way, this has nothing to do with UTF-8. What you will get will be a Java String which contains a modified form of UTF-16.
For PHP, try html_entity_decode
精彩评论