From:             
Operating system: Linux
PHP version:      5.3.6
Package:          Strings related
Bug Type:         Bug
Bug description:case insensitive search of stripos does not work when searching 
äöü in utf-8 

Description:
------------
---

>From manual page: http://www.php.net/function.stripos#Description

---

If some text is encoded in UTF-8 and I search this text with stripos for a
string with (e.g.) lower case Umlaut (e.g. ü), this function does not find
the upper-case Umlaut (Ü). That means case-insensitive does not work for
Umlauts if a text file is encoded UTF-8.

Test script:
---------------
File test.txt contains "Übermut" and is encoded UTF-8 without BOM

<?php

$text = file_get_contents("test.txt");

echo $text."<br>";

$str = "über";

if (($pos=stripos($text,$str)) !== false)

        echo $str." gefunden";

else echo $str." nicht gefunden";

?>

Expected result:
----------------
Übermut

über gefunden 

Actual result:
--------------
Übermut

über nicht gefunden 

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54688&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54688&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54688&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54688&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54688&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54688&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54688&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54688&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54688&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54688&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54688&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54688&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54688&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54688&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54688&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54688&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54688&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54688&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54688&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54688&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54688&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54688&r=mysqlcfg

Reply via email to