tchwork / utf8

Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP
Apache License 2.0
627 stars 50 forks source link

How to use TurkishUtf8 #30

Closed fisharebest closed 10 years ago

fisharebest commented 10 years ago

The documentation mentions a TurkishUtf8 class, but does not say how to use it.

// bootstrap.php
if ($language == 'tr') {
    // What goes here?
} else {
    \Patchwork\Utf8\Bootup::initAll();UTF-8
    \Patchwork\Utf8\Bootup::filterRequestUri();
    \Patchwork\Utf8\Bootup::filterRequestInputs();
}
fisharebest commented 10 years ago

I think I understand now. I must write my own function.

function my_strtoupper($x) {
  global $language;
  if ($language == 'tr' || $language == 'az') {
    return Utf8Turkish::strtoupper($x);
  } else {
    return Utf8::strtoupper($x);
  }
}
nicolas-grekas commented 10 years ago

Right, you got it!