From: Klaus <kl...@st...> - 2009-10-19 10:03:20
|
If that works, we should put that to config as well (-> customfields!!!) ----------------ursprüngliche Nachricht----------------- Von: "jaytraxx" chr...@ja... An: egr...@li... Datum: Mon, 19 Oct 2009 02:55:18 -0700 (PDT) ------------------------------------------------- > > Hi folks, > > found a solution: > > in phpgwapi/inc/class.preferences.inc.php, LINE 250: > $value = unserialize($row['preference_value']); > if($value === false) > { > // manually retrieve the string lengths of the serialized array if > unserialize failed > $value = unserialize(preg_replace('!s:(\d+):"(.*?)";!se', > "'s:'.mb_strlen('$2','8bit').':\"$2\";'", $row['preference_value'])); > } > > ... will soon commit that to /trunk. > > christian > > jaytraxx wrote: >> >> it works partially, maybe you have an idea: >> >> in phpgwapi/inc/class.preferences.inc.php, LINE 250: >> $value = unserialize($row['preference_value']); >> if($value === false) >> { >> // something went wrong while trying to unserialize (maybe a charset >> problem) >> // retry it by manually generating the string lengths >> $out = preg_replace('!s:(\d+):"(.*?)";!se', >> "'s:'.strlen('$2').':\"$2\";'", $row['preference_value'] ); >> $value = unserialize($out); >> } >> >> the values are now correctly read before I login to EGw. After login, they >> are vanished again. Maybe it's something to do with writing into the >> session after login. >> >> Greetings >> christian >> >> jaytraxx wrote: >>> >>> tried, but it doesn't work :-( >>> I'll try further... maybe it's getting better ... >>> >>> christian >>> >>> >>> Leithoff, Klaus wrote: >>>> >>>> Sounds better, try. >>>> >>>> ----------------ursprüngliche Nachricht----------------- >>>> Von: "jaytraxx" chr...@ja... >>>> An: egr...@li... >>>> Datum: Tue, 13 Oct 2009 05:50:56 -0700 (PDT) >>>> ------------------------------------------------- >>>> >>>> >>>>> >>>>> I found one hint on php.net: >>>>> $out = preg_replace('!s:(\d+):"(.*?)";!se', >>>>> "'s:'.strlen('$2').':\"$2\";'", >>>>> $serialized ); >>>>> $value = unserialize($out); >>>>> >>>>> This re-calclulates every stringlen of every value before giving >>>>> the >>>> string >>>>> to unserialize(), means: >>>>> a:17:{s:8:"currency";s:1:"€" .... >>>>> gets >>>>> a:17:{s:8:"currency";s:3:"€" .... >>>>> >>>>> What do you think? >>>>> Greetings >>>>> christian >>>>> >>>>> >>>>> >>>>> jaytraxx wrote: >>>>>> >>>>>> Hi folks, >>>>>> >>>>>> I'm currently migrating our EGw from iso charset to utf-8. I do >>>>>> that >>>>>> in >>>>>> setup with a database export and re-import it with the new >>>>>> system >>>> charset. >>>>>> >>>>>> It's working mostly fine. The only problem comes up with >>>>>> serialized >>>> arrays >>>>>> (e.g. preferences) which include special characters, like >>>>>> e.g. the € >>>> (EUR) >>>>>> sign. >>>>>> >>>>>> In ISO, the € (EUR) value is serialized like that: >>>>>> a:17:{s:8:"currency";s:1:"€" .... >>>>>> >>>>>> If I re-import the database now with utf-8 as charset, nothing >>>>>> is >>>>>> changed >>>>>> on the serialized array on re-import. It remains with >>>>>> a:17:{s:8:"currency";s:1:"€" .... >>>>>> But, the € (EUR) sign in UTF-8 is three chars long and until I >>>>>> don't >>>>>> change the value to >>>>>> a:17:{s:8:"currency";s:3:"€" .... >>>>>> all unserialize calls on the string end up with "false". >>>>>> >>>>>> Anyone out there having a fix for that is welcome. I just want to >>>>>> avoid >>>>>> changing all the serialized fields by myself. Maybe there is a >>>> possibility >>>>>> to adjust the value length somehow on re-import time. >>>>>> >>>>>> Greetings >>>>>> christian >>>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> >>>>> http://www.nabble.com/unserialize-problem-on-charset-convers >>>>> ion-tp25 >>>>> 871424s3741p25872316.html >>>>> Sent from the egroupware-developers mailing list archive at >>>>> Nabble.com. >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------ >>>>> -------- >>>>> ---------- >>>>> Come build with us! The BlackBerry(R) Developer Conference in SF, >>>>> CA >>>>> is the only developer event you need to attend this year. Jumpstart >>>>> your >>>>> developing skills, take BlackBerry mobile applications to >>>>> market and >>>>> stay >>>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >>>>> http://p.sf.net/sfu/devconference >>>>> _______________________________________________ >>>>> eGroupWare-developers mailing list >>>>> eGr...@li... >>>>> >>>>> https://lists.sourceforge.net/lists/listinfo/egroupware-deve >>>>> lopers >>>>> >>>> >>>> -- >>>> Stylite GmbH >>>> [ open style of IT ] >>>> Morschheimer Strasse 15 >>>> 67292 Kirchheimbolanden >>>> >>>> fon 06352 . 70629-0 >>>> fax 06352 . 70629-30 >>>> www.stylite.de >>>> >>>> Geschäftsführer: Andre Keller, Gudrun Müller, Ralf Becker >>>> Handelsregister Kaiserslautern HRB 30575 >>>> USt-ID: DE214280951 >>>> SteuerNr. 44/667/1114/3 >>>> >>>> >>>> >>>> >>>> -------------------------------------------------------------- >>>> ---------------- >>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>>> is the only developer event you need to attend this year. Jumpstart >>>> your >>>> developing skills, take BlackBerry mobile applications to market >>>> and >>>> stay >>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >>>> http://p.sf.net/sfu/devconference >>>> _______________________________________________ >>>> eGroupWare-developers mailing list >>>> eGr...@li... >>>> >>>> https://lists.sourceforge.net/lists/listinfo/egroupware-develo >>>> pers >>>> >>>> >>> >>> >> >> > > -- > View this message in context: > http://www.nabble.com/unserialize-problem-on-charset-conversion-tp25 > 871424s3741p25955739.html > Sent from the egroupware-developers mailing list archive at Nabble.com. > > > > -------------------------------------------------------------------- > ---------- > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > eGroupWare-developers mailing list > eGr...@li... > https://lists.sourceforge.net/lists/listinfo/egroupware-developers > |