我想请求帮助解决这个问题:
我一直在使用ckeditor很长一段时间,但几周前我意识到UTF8编码存在一些问题。我已经在元标记和MySQL DB中正确设置了UTF8编码(设置了utf8_czech_ci)。
例如,输入“ěščřž”输出(保存到DB)“Ä>šřž”
哪里可能是问题?
谢谢
答案 0 :(得分:0)
如果需要,您可以使用:
CKEDITOR.config.entities_processNumerical = 'force'; //Whether to convert all remaining characters not included in the ASCII character table to their relative decimal numeric representation of HTML entity. When set to force, it will convert all entities into this format. For example : 汉语."
它会将“ěščřž”转换为& #34; &安培; #283; &安培; #353; &安培; #269; &安培; #345; &安培; #382; &安培; #34;
答案 1 :(得分:0)
$var = trim(html_entity_decode($var, ENT_COMPAT, "UTF-8"));