As far as I know Zend uses preg_replace to emulate trim's behaviour ----- Mensaje original ----- > Actually, after a bit of thinking, I started to wonder if trim() was > multibyte-friendly. > > I did a bit of poking around and found this: > http://osdir.com/ml/php.internationalization/2003-05/msg00004.html > > You may have to use regex to trim the strings, or supply a list of > characters > not including the null-byte (\0) when trimming your strings. > > See if that helps, > -Kizano > //----- > Information Security > eMail: [email protected] > http://www.markizano.net/ > > On 06/17/2011 05:37 AM, Antonio Caccese wrote: > > Why i have to use iconv if there is the StringTrim filter? > > > > I aspect that StringTrim's behavior is like the native PHP function > > trim. > > > > I'm italian and we use accented letters. The StringTrim filter works > > fine, for > > example, on the string " La città è bella " and returns "La città è > > bella" but > > if the string is "La città" the filter returns "La citt�" and when > > save into the > > DB the application throws the Exception: > > > > Message: SQLSTATE[HY000]: General error: 1366 Incorrect string > > value: '\xC3' for > > column 'column_name' at row 1 > > > > I think it is a bug. > > ZF version 1.11.3 > > > > > > > > Il 17/06/2011 00:23, Mark Harris ha scritto: > >> http://us3.php.net/iconv > >> > >> Hope this helps :) > >> //----- > >> Information Security > >> eMail: [email protected] > >> http://www.markizano.net/ > >> > >> On 06/16/2011 08:45 AM, Antonio Caccese wrote: > >>> Hi, > >>> i'have a problem with the StringTrim filter and accented letter > >>> 'à' at the end > >>> of words. > >>> If character 'à' is at the end of the string the filter returns > >>> the bad > >>> character � and when save it in the DB it throws the following > >>> exception: > >>> > >>> SQLSTATE[HY000]: General error: 1366 Incorrect string value: > >>> '\xC3' for column > >>> 'categoria' at row 1 > >>> > >>> All is well configured to works with UTF-8, IDE Editor, Database, > >>> page encoding, > >>> ecc. > >>> Any suggestions? > >>> > >>> > > > > > > -- > List: [email protected] > Info: http://framework.zend.com/archives > Unsubscribe: [email protected]
-- Alayn Gortazar Irontec, Internet y Sistemas sobre GNU/LinuX - http://www.irontec.com +34 94.404.81.82 -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
