Bug #64057 [Com]: substr_replace failed charset utf-8
Edit report at https://bugs.php.net/bug.php?id=64057&edit=1
ID: 64057
Comment by: mail+php at requinix dot net
Reported by: ltsujiguchi at gmail dot com
Summary: substr_replace failed charset utf-8
Status: Open
Type: Bug
Package: Strings related
Operating System: Ubuntu 12.10
PHP Version: 5.4.11
Block user comment: N
Private report: N
New Comment:
Do you have one of those weird editors where shift+space produces something
besides a regular space? It may sound stupid and probably won't change anything
but try deleting the "LIKE ?" and typing it again carefully.
Also stupid and pointless, check that
echo bin2hex($cond);
ends in "...4c494b45203f".
Previous Comments:
------------------------------------------------------------------------
[2013-01-23 18:21:39] krakjoe@php.net
[joe@fiji php-5.4.6]$ nano 64057.php
[joe@fiji php-5.4.6]$ sapi/cli/php 64057.php
noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE %é%
Anyone else ??
------------------------------------------------------------------------
[2013-01-23 17:54:21] ltsujiguchi at gmail dot com
Description:
------------
I had a problem when i used the substr_replace, using those changes os php.ini:
I couldn't find the exact version of my php on the drop, so i put the closest
version, but my real version is the 5.4.6.
Result expected:
noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE %é%
Result returned:
noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE%é%?
Test script:
---------------
$replacement = '%é%';
$cond = 'noticia.noticia_titulo LIKE ? OR noticia.noticia_conteudo LIKE ?';
$posItem = stripos($cond, '?');
$cond = substr_replace($cond, $replacement, $posItem, 1);
$posItem = stripos($cond, '?');
$cond = substr_replace($cond, $replacement, $posItem, 1);
echo $cond;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64057&edit=1
Thread (12 messages)
- ltsujiguchi at gmail dot com
- krakjoe@php.netBug #64057 [Opn]: substr_replace failed charset utf-8
- mail+php at requinix dot netBug #64057 [Com]: substr_replace failed charset utf-8
- aharvey@php.netBug #64057 [Opn->Fbk]: substr_replace failed charset utf-8
- ltsujiguchi at gmail dot comBug #64057 [Com]: substr_replace failed charset utf-8
- ltsujiguchi at gmail dot comBug #64057 [Fbk->Opn]: substr_replace failed charset utf-8
- ltsujiguchi at gmail dot comBug #64057 [Com]: substr_replace failed charset utf-8
- ltsujiguchi at gmail dot comBug #64057 [Com]: substr_replace failed charset utf-8
- datibbaw@php.netBug #64057 [Opn]: substr_replace failed charset utf-8
- yohgaki@php.netBug #64057 [Opn->Fbk]: substr_replace failed charset utf-8
- php-bugs at lists dot php dot netBug #64057 [Fbk->NoF]: substr_replace failed charset utf-8
- php-bugs at lists dot php dot netBug #64057 [Fbk->NoF]: substr_replace failed charset utf-8