Note that strings in memory (when manipulated by PHP) should always be
in UTF8, and this whatever is the database code page. Convertion is done
silently by database driver.
Check $dolibarr_main_db_character_set value.
It is used by driver to know what is code page of database.

For example, if your database codepage is latin, then when you get data
doing $obj->myfield, value should be in utf8. If not, this probably
means, there is a problem into your dolibarr conf file setup.
But may be PHP need mb_string when database is not utf8 to do this work
of converting on the fly data from database.
I did like suggested by raphael, i added "mb_string" as a prerequisite.





Le 17/02/2014 16:19, Doursenaud, Raphaël a écrit :
> Then, it's just a matter of documenting the fact that we need mbstring
> for Dolibarr to work properly and disallow AJAX if mbstring is not
> present. Right ?
>
> Dolibarr PHP extensions dependencies :
> http://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries
>
>
> 2014-02-17 12:01 GMT+01:00 Christophe Battarel
> <christophe.batta...@altairis.fr
> <mailto:christophe.batta...@altairis.fr>>:
>
>     as i wrote before, it seems to be a little problem with json
>     encoding strings if  mbstring is not active on the server (details
>     below in the first message).
>
>
>     Le 17/02/2014 11:52, Destailleur Laurent a écrit :
>>     I think so.
>>     Even if there is not a lot of test for such cases.
>>
>>
>>     2014-02-16 4:25 GMT+01:00 Marcos García <marcos...@gmail.com
>>     <mailto:marcos...@gmail.com>>:
>>
>>         So... the question is... Do we support non-utf8 databases?
>>
>>         Regards,
>>          
>>
>>             *Marcos García*
>>
>>             marcos...@gmail.com <mailto:marcos...@gmail.com>
>>
>>
>>
>>         2014-02-01 13:20 GMT+01:00 Christophe Battarel
>>         <christophe.batta...@altairis.fr
>>         <mailto:christophe.batta...@altairis.fr>>:
>>
>>             if a dolibarr instance works with a non utf8 database for
>>             instance, you should then encode strings (via the
>>             utf8_encode php function) before encoding them to json;
>>             otherwise json encoding doesn't return valid json string
>>             and ajax call fails.
>>
>>             Le 01/02/2014 12:57, Marcos García a écrit :
>>>             Where did you find that Dolibarr does not use UTF-8?
>>>
>>>             Regards,
>>>              
>>>
>>>                 *Marcos García*
>>>
>>>                 marcos...@gmail.com <mailto:marcos...@gmail.com>
>>>
>>>
>>>
>>>             2014-01-30 Christophe Battarel
>>>             <christophe.batta...@altairis.fr
>>>             <mailto:christophe.batta...@altairis.fr>>:
>>>
>>>                 Hello everybody,
>>>
>>>                 I've just had a problem with ajax product search
>>>                 that wasn't working for certain products on document
>>>                 "add line" feature.
>>>                 After insvestigating, it was "because" mb_string was
>>>                 not active on the server. mbstring is used by the
>>>                 dol_trunc function to take care of the character
>>>                 encoding when truncating strings.
>>>
>>>                 In second thought, i checked deeply our code and
>>>                 realized that there was no utf8 encoding for json
>>>                 strings though it is mandatory ("All string data
>>>                 must be UTF-8 encoded." source:
>>>                 http://us3.php.net/manual/fr/function.json-encode.php)
>>>
>>>                 I prefer first posting a message here to have
>>>                 confirmation of my assertions; then if i'm right, it
>>>                 would be nice to fix it, but i don't realize the
>>>                 amount of work yet.
>>>
>>>                 Best regards
>>>                 Christophe
>>>
>>>                 -- 
>>>                 Christophe Battarel
>>>                 Responsable technique
>>>                 sarl altairis
>>>                 Informatique et Web en Grésivaudan
>>>                 33 Grande Rue
>>>                 38570 Goncelin
>>>                 09 52 71 70 96 <tel:09%2052%2071%2070%2096> (appel local)
>>>                 cont...@altairis.fr <mailto:cont...@altairis.fr>
>>>                 http://www.altairis.fr 
>>>
>>>
>>>                 _______________________________________________
>>>                 Dolibarr-dev mailing list
>>>                 Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
>>>                 https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>>>
>>>
>>>
>>>
>>>             _______________________________________________
>>>             Dolibarr-dev mailing list
>>>             Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
>>>             https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>>
>>
>>             -- 
>>             Christophe Battarel
>>             Responsable technique
>>             sarl altairis
>>             Informatique et Web en Grésivaudan
>>             33 Grande Rue
>>             38570 Goncelin
>>             09 52 71 70 96 <tel:09%2052%2071%2070%2096> (appel local)
>>             cont...@altairis.fr <mailto:cont...@altairis.fr>
>>             http://www.altairis.fr 
>>
>>
>>             _______________________________________________
>>             Dolibarr-dev mailing list
>>             Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
>>             https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>>
>>
>>
>>         _______________________________________________
>>         Dolibarr-dev mailing list
>>         Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
>>         https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>>
>>
>>
>>
>>     -- 
>>     Laurent Destailleur (alias Eldy)
>>     
>> ------------------------------------------------------------------------------------
>>     Social networks of my OpenSource projects:
>>     Dolibarr Google+: https://plus.google.com/+DolibarrOrg/
>>     Dolibarr Facebook: https://www.facebook.com/dolibarr
>>     Dolibarr Twitter: http://www.twitter.com/dolibarr
>>     AWStats Google+: https://plus.google.com/+AWStatsOrgPoject/
>>     AWStats Facebook: https://www.facebook.com/awstats.org
>>     AWStats Twitter: http://www.twitter.com/astats_project
>>
>>
>>
>>     _______________________________________________
>>     Dolibarr-dev mailing list
>>     Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
>>     https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>
>
>     -- 
>     Christophe Battarel
>     Responsable technique
>     sarl altairis
>     Informatique et Web en Grésivaudan
>     33 Grande Rue
>     38570 Goncelin
>     09 52 71 70 96 <tel:09%2052%2071%2070%2096> (appel local)
>     cont...@altairis.fr <mailto:cont...@altairis.fr>
>     http://www.altairis.fr 
>
>
>     _______________________________________________
>     Dolibarr-dev mailing list
>     Dolibarr-dev@nongnu.org <mailto:Dolibarr-dev@nongnu.org>
>     https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>
>
>
>
> -- 
> *Raphaël Doursenaud*
> +33 (0)5 35 53 97 13 - +33 (0)6 68 48 20 10
>
> <http://gpcsolutions.fr>
> http://gpcsolutions.fr
> Technopole Hélioparc
> 2 avenue du Président Pierre Angot
> 64053 PAU CEDEX 9
> SARL GPC.solutions au capital de 7 500 EUR - R.C.S. PAU 528 995 921
> <https://www.google.com/a/partnersearch/#partner?partner_id=46687933_a0n60000000sqpWAAQ><http://wiki.dolibarr.org/index.php/Dolibarr_suppliers_France#GPC.solutions>
>
>
> _______________________________________________
> Dolibarr-dev mailing list
> Dolibarr-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev


-- 
Eldy (Laurent Destailleur).

EMail: e...@destailleur.fr
Web: http://www.destailleur.fr

Dolibarr (Project leader): http://www.dolibarr.org
To make a donation for Dolibarr project via Paypal: cont...@destailleur.fr
AWStats (Author) : http://awstats.sourceforge.net
To make a donation for AWStats project via Paypal: cont...@destailleur.fr
AWBot (Author) : http://awbot.sourceforge.net
CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net

_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à