php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50780 strtolower UTF-8 encoding issue
Submitted: 2010-01-16 20:56 UTC Modified: 2010-01-16 21:09 UTC
From: hlegius at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.2.12 OS: Windows 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hlegius at gmail dot com
New email:
PHP Version: OS:

 

 [2010-01-16 20:56 UTC] hlegius at gmail dot com
Description:
------------
strtolower encoding problem in UTF-8 mode at Windows 7.

Reproduce code:
---------------
<?php

echo strtolower("H?LIO"); // returns: h&#65533;lio (error)
echo strtoupper("h?lio"); // returns H?LIO (ok)

?>

Expected result:
----------------
<?php
// expected results

echo strtolower("H?LIO"); // returns: h?lio
echo strtoupper("h?lio"); // returns H?LIO

?>

Actual result:
--------------
<?php

echo strtolower("H?LIO"); // returns: h&#65533;lio (error)
echo strtoupper("h?lio"); // returns H?LIO (ok)

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-16 21:03 UTC] jani@php.net
Yea, you're supposed to use mbstring for this stuff. Or iconv. PHP 6 will have support for unicode.
 [2010-01-16 21:09 UTC] hlegius at gmail dot com
Yeah, I can, but it is a PHP bug, anyway ! In older versions - 5.2.6 this does not happen.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 06:01:29 2025 UTC