Package org.apache.abdera.i18n.iri

Examples of org.apache.abdera.i18n.iri.NameprepCodepointIterator


* 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) {
View Full Code Here

TOP

Related Classes of org.apache.abdera.i18n.iri.NameprepCodepointIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.