Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.regex.Pattern;

public class UnicodeReplacer {
// Pattern to detect Unicode sequences like \u00E9
private static final Pattern UNICODE_PATTERN = Pattern.compile("\\\\u([0-9A-Fa-f]{4})");

/**
Expand All @@ -15,7 +14,7 @@ public class UnicodeReplacer {
*/
public static String replaceUnicode(String input) {
Matcher matcher = UNICODE_PATTERN.matcher(input);
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();

while (matcher.find()) {
// Converts the Unicode sequence to its equivalent character
Expand All @@ -27,6 +26,4 @@ public static String replaceUnicode(String input) {
matcher.appendTail(result);
return result.toString();
}

}

}
Loading