Commit 947ce706 authored by iwakeh's avatar iwakeh Committed by Karsten Loesing
Browse files

Provide utf-characters instead of escape strings.

Also adapt tests to check the new functionality.
Implements task-25740.
parent 59eb04b1
# Changes in version 6.0-1.13.0 - 2018-04-??
* Minor changes
- Turn valid utf-8 escape sequences into utf-8 characters.
# Changes in version 5.2-1.12.0 - 2018-04-06
* Medium changes
......@@ -3,6 +3,8 @@
package org.torproject.onionoo.util;
import static org.apache.commons.lang3.StringEscapeUtils.unescapeJava;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -58,8 +60,8 @@ public class FormattingUtils {
StringBuffer sb = new StringBuffer();
Matcher mat = escapePattern.matcher(text);
while (mat.find()) {
String unescaped =;
mat.appendReplacement(sb, unescaped);
String unescaped =;
mat.appendReplacement(sb, unescapeJava(unescaped));
return sb.toString();
......@@ -2,15 +2,21 @@
\\\\u00bb \\\\u \\\\u00ab
» \\\\u «
some \\\\u20ac other string \\\\u0024 to unescape
some \\u20ac other string \\u0024 to unescape
abcd efg\\\\u0024xyz\\\\uxxxx
abcd efg\\u0024xyz\\\\uxxxx
Euro \\\\u20ac
Euro €
Dollar \\\\u0024
Dollar $
Pound \\\\u00a3
Pound £
Yen \\\\u00a5
Yen ¥
\\\\u00a1some \\\\u00dE other string \\\\u00e7 to unescape!
¡some Þ other string ç to unescape!
abcd efg cent \\\\u00a2xyz\\\\uxxxx
abcd efg cent ¢xyz\\\\uxxxx
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment