简体   繁体   中英

common_schema extract_json_value ans special chars

I'm using extract_json_value from common_schema ( http://common-schema.googlecode.com/ ) to json_decode a field in my MySQL database. It works pretty well...exept for accents.

SELECT common_schema.extract_json_value(value,'prenom') as prenom
FROM metadata where idmetadata = 720871;

returns: Aur\élien

field value in database is: {"prenom":"Aur\élien","classe":"CP"}

Any idea on how i can get "Aurélien" and not "Aur\élien" ?

Thanks

Your issue doesn't seem to be with common schema, but with your charset. Make sure

  1. your MySQL database (and all tables) collation is utf8-general-ci

  2. Your web forms include the HTML attribute accept-charset="UTF-8"

  3. Your html pages include <meta charset="utf-8">

  4. If using gettext for translation, set the codeset in PHP: bind_textdomain_codeset($domain, 'UTF-8');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM