lookupReplacement example

// These two Unicode ranges include the accented US-ASCII letters, with a       // few characters that aren't accented letters mixed in. So define the       // ranges and the excluded characters.       $range1 = $code > 0x00bf && $code < 0x017f;
      $exclusions_range1 = [0x00d0, 0x00d7, 0x00f0, 0x00f7, 0x0138, 0x014a, 0x014b];
      $range2 = $code > 0x01cc && $code < 0x0250;
      $exclusions_range2 = [0x01DD, 0x01f7, 0x021c, 0x021d, 0x0220, 0x0221, 0x0241, 0x0242, 0x0245];

      $replacement = $character;
      if (($range1 && !in_array($code$exclusions_range1)) || ($range2 && !in_array($code$exclusions_range2))) {
        $to_add = $this->lookupReplacement($code, 'xyz');
        if (strlen($to_add) === 1) {
          $replacement = $to_add;
        }
        elseif (isset($this->fixTransliterateForRemoveDiacritics[$to_add])) {
          $replacement = $this->fixTransliterateForRemoveDiacritics[$to_add];
        }
      }

      $result .= $replacement;
    }

    
Home | Imprint | This part of the site doesn't use cookies.