question: 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 ( ) ; }
target:  Strip all non-characters, which can cause SolrReducer problems if present. This is borrowed from Apache Nutch.