开发者

Smarty: special characters get changed unwanted- utf8 [duplicate]

开发者 https://www.devze.com 2023-01-30 06:35 出处:网络
This question already has answers here: UTF-8 all the way through (13 answers) Closed 5 years ago. I\'ve data with special characters (french accent grave). When I select with php script
This question already has answers here: UTF-8 all the way through (13 answers) Closed 5 years ago.

I've data with special characters (french accent grave). When I select with php script and output (print) it looks fine. When I pass to Smarty the characters get changed. My html has follwoing setting: meta http-equiv="content-type" content="text/html; charset=utf-8" Not su开发者_如何学Pythonre what's missing or incorrect?

gr, Patrick


Put this at the beginning of yours php file and check:

// utf-8

header("Pragma: no-cache"); header('Content-type: text/html; charset=utf-8');

// mbstring UTF8 coding (optional)

mb_detect_order(array('UTF-8', 'ASCII')); mb_internal_encoding('UTF-8'); mb_http_output('UTF-8'); mb_regex_encoding('UTF-8');

0

精彩评论

暂无评论...
验证码 换一张
取 消