Shouldn't it be called unicode_collator.c?

-Andrei


On Mar 26, 2006, at 3:06 AM, Derick Rethans wrote:

derick          Sun Mar 26 11:06:24 2006 UTC

  Added files:
    /php-src/ext/unicode        collator.c

  Modified files:
    /php-src/ext/standard       array.c php_array.h
    /php-src/ext/unicode        config.m4 config.w32 php_unicode.h unicode.c
  Log:
- Implemented basic collation support. For some reason "new Collator" gives segfaults when the object's collation resource is used.
  - The following example shows what is implemented:

  <?php
  $orig = $strings = array(
      'côte',
      'cote',
      'côté',
      'coté',
      'fluße',
      'flüße',
  );

  echo "German phonebook:\n";
  $c = collator_create( "[EMAIL PROTECTED]" );
  foreach($c->sort($strings) as $string) {
      echo $string, "\n";
  }
  echo $c->getAttribute(Collator::FRENCH_COLLATION) == Collator::ON
      ? "With" : "Without", " french accent sorting order\n";

  echo "\nFrench with options:\n";
  $c = collator_create( "fr" );
  $c->setAttribute(Collator::CASE_FIRST, Collator::UPPER_FIRST);
  $c->setAttribute(Collator::CASE_LEVEL, Collator::ON);
  $c->setStrength(Collator::SECONDARY);
  foreach($c->sort($strings) as $string) {
      echo $string, "\n";
  }
  echo $c->getAttribute(Collator::FRENCH_COLLATION) == Collator::ON
      ? "With" : "Without", " french accent sorting order\n";
  ?>

<derick-20060326110624.txt>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to