Doc #70799 [Ver->Csd]: strcasecmp is not locale aware
Edit report at https://bugs.php.net/bug.php?id=70799&edit=1
ID: 70799
Updated by: git@php.net
Reported by: yurets at gambler dot ru
Summary: strcasecmp is not locale aware
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Strings related
Operating System: FreeBSD 10.1
PHP Version: 5.6.14
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb69
Revision: https://github.com/php/doc-en/commit/5dcdcf32f847c297f1fe174aea802a489cecaf1d
Log: Fix #70799: strcasecmp is not locale aware
Previous Comments:
------------------------------------------------------------------------
[2020-01-27 11:20:19] cmb@php.net
That behavior is to be expected, since strcasecmp() is *not*
locale aware (it only handles ASCII characters properly regarding
case-insensivity). That needs to be documented.
------------------------------------------------------------------------
[2015-10-27 05:30:54] yurets at gambler dot ru
Description:
------------
---
From manual page: http://www.php.net/function.strcasecmp
---
It's the same CP1251 symbol used in test script, upper- and lower-cased
No problems if using strtolower or strtoupper, only strcasecmp is affected.
Test script:
---------------
<?
setlocale( LC_ALL, "ru_RU.CP1251", "rus_RUS.CP1251",
"Russian_Russia.1251" );
echo strcasecmp( "Ð", "а" );
?>
Expected result:
----------------
0
Actual result:
--------------
-32
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70799&edit=1
Thread (2 messages)