private char foldCase(char ch){
  if (ch < 128) {
    if ('A' <= ch && ch <= 'Z') {
      return (char)(ch + ('a' - 'A'));
    }
    return ch;
  }
  return Character.toLowerCase(Character.toUpperCase(ch));
}

private char foldCase ( char ch ) { if ( ch < 128 ) { if ( 'A' <= ch && ch <= 'Z' ) { return ( char ) ( ch + ( 'a' - 'A' ) ) ; } return ch ; } return Character . toLowerCase ( Character . toUpperCase ( ch ) ) ; }
this isn ' t equivalent to either of icu ' s u_foldcase case folds , and thus any of the unicode case folds , but it ' s what the ri uses .
