Sub AppStart (Args() As String)
Log(Me.as(JavaObject).RunMethod("defunkyfy",Array("Café au lait")))
End Sub
#if java
import java.text.*;
import java.util.regex.Pattern;
public static String defunkyfy(String unicodeString) {
String normalizedString = Normalizer.normalize(unicodeString, Normalizer.Form.NFD);
Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
String asciiString = pattern.matcher(normalizedString).replaceAll("");
StringBuilder result = new StringBuilder();
for (char c : asciiString.toCharArray()) {
if (c <= 127) {
result.append(c);
}
}
return result.toString();
}
#End If