php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43671 Problem with converting utf-8 to cp1251
Submitted: 2007-12-25 02:07 UTC Modified: 2007-12-25 10:16 UTC
From: svimik at mail dot ru Assigned:
Status: Not a bug Package: ICONV related
PHP Version: 5.2.5 OS: Windows Server 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 - 9 = ?
Subscribe to this entry?

 
 [2007-12-25 02:07 UTC] svimik at mail dot ru
Description:
------------
I found a problem with symbol \xC2\xB4
In text editors this symbol looks like "`".
But iconv() stops converting at this symbol.
The code is below.
It returns "Soil" instead of "Soil?s Song".

Reproduce code:
---------------
echo iconv('utf-8', 'cp1251', "Soil\xC2\xB4 Song");

Expected result:
----------------
Soil

Actual result:
--------------
Soil`s Song

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-25 02:09 UTC] svimik at mail dot ru
I have found a problem with symbol \xC2\xB4
In text editors this symbol looks like "`".
But iconv() stops converting at this symbol.
The code is below.
It returns "Soil" instead of "Soil?s Song".
 [2007-12-25 10:16 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

That's because the "U+00B4 ACUTE ACCENT" character is not part of cp1251. It is a different character than "U+0060 GRAVE ACCENT".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 14:01:29 2024 UTC