58 throw new UnexpectedValueException(
"Alphabet must be < 64 items" );
62 $this->puaSubset = [];
64 for ( $i = 0; $i < $len; $i++ ) {
65 $this->puaSubset[] =
"\xF3\xB3\x80" . chr( $i + 128 );
67 parent::__construct(
$lang );
71 return str_replace( $this->alphabet, $this->puaSubset, $string );
75 return $this->
convertToPua( parent::getSortKey( $string ) );
83 return parent::getFirstLetter(
84 str_replace( $this->puaSubset, $this->alphabet, $string )
Resort normal UTF-8 order by putting a bunch of stuff in PUA.
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.
__construct(array $alphabet, Language $lang)
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
Internationalisation code.
Collation that orders text with numbers "naturally", so that 'Foo 1' < 'Foo 2' < 'Foo 12'.