* Implements the Nameprep protocol
*/
public class Nameprep {
public static String prep(String s, boolean allowunassigned) {
NameprepCodepointIterator r = null;
try {
StringBuffer buf = new StringBuffer();
CodepointIterator ci = CodepointIterator.forCharSequence(s);
r = new NameprepCodepointIterator(ci,allowunassigned);
while(r.hasNext()) {
int i = r.next();
if (i != -1)
buf.append((char)i);
}
return Normalizer.normalize(buf.toString(),Normalizer.Form.KC).toString();
} catch (Throwable e) {