tertiaryCollator = Collator::create( 'fa' ); } public function getPrimarySortKey( $string ) { $primary = parent::getPrimarySortKey( $string ); // We have to use a tertiary sortkey for everything with the primary sortkey of 2627. // Otherwise, the "Remove duplicate prefixes" logic in IcuCollation would remove them. // This matches sortkeys for the following characters: ء ئ ا و ٲ ٳ if ( substr( $primary, 0, 2 ) === "\x26\x27" ) { wfDebug( "Using tertiary sortkey for '$string'\n" ); return $this->tertiaryCollator->getSortKey( $string ); } return $primary; } }