From:             8umucsxy at terra dot es
Operating system: 
PHP version:      4.4.2
PHP Bug Type:     Feature/Change Request
Bug description:  array_multisort SORT_STRING not working as a MySQL SELECT 
with ORDER BY would

Description:
------------
There is a problem with array_multisort in languages other than English.
For special chars, as A with accent (Á), the sorting does not correspond
to what might expect from a MySQL SELECT with ORDER BY.
 
For example the code attached to the message
  
will sort the array in this way: ABADIA, ALVAREZ, BUÑUEL, ZUBIETA,
ÁLVARES
 
while a MySQL SELECT with ORDER BY nombre ASC will yield
 
ABADIA, ÁLVARES, ALVEREZ, BUÑUEL, ZUBIETA
 
as A and Á are considered two different representations of the same
letter.


Reproduce code:
---------------
 foreach ($students as $key => $row){
          $surname[$key] = $row['surname'];
       }
       array_multisort($surname, SORT_ASC, $students);


Expected result:
----------------
ABADIA, ÁLVARES, ALVEREZ, BUÑUEL, ZUBIETA

Actual result:
--------------
ABADIA, ALVAREZ, BUÑUEL, ZUBIETA, ÁLVARES

-- 
Edit bug report at http://bugs.php.net/?id=37480&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37480&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37480&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37480&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37480&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37480&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37480&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37480&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37480&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37480&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37480&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37480&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37480&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37480&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37480&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37480&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37480&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37480&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37480&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37480&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37480&r=mysqlcfg

Reply via email to