php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70799 strcasecmp works incorrect for CP1251
Submitted: 2015-10-27 05:30 UTC Modified: 2018-02-28 21:59 UTC
From: yurets at gambler dot ru Assigned:
Status: Open Package: Strings related
PHP Version: 5.6.14 OS: FreeBSD 10.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-10-27 05:30 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-28 21:59 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: Strings related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Nov 12 19:01:35 2019 UTC