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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC