private static String stripNonCharCodepoints(String input){
  StringBuilder stripped=new StringBuilder(input.length());
  char ch;
  for (int i=0; i < input.length(); i++) {
    ch=input.charAt(i);
    if (ch % 0x10000 != 0xffff && ch % 0x10000 != 0xfffe && (ch <= 0xfdd0 || ch >= 0xfdef) && (ch > 0x1F || ch == 0x9 || ch == 0xa || ch == 0xd)) {
      stripped.append(ch);
    }
  }
  return stripped.toString();
}

private static String stripNonCharCodepoints ( String input ) { StringBuilder stripped = new StringBuilder ( input . length ( ) ) ; char ch ; for ( int i = 0 ; i < input . length ( ) ; i ++ ) { ch = input . charAt ( i ) ; if ( ch % 0x10000 != 0xffff && ch % 0x10000 != 0xfffe && ( ch <= 0xfdd0 || ch >= 0xfdef ) && ( ch > 0x1F || ch == 0x9 || ch == 0xa || ch == 0xd ) ) { stripped . append ( ch ) ; } } return stripped . toString ( ) ; }
strip all non - characters , which can cause solrreducer problems if present . this is borrowed from apache nutch .
