Smarty Template Output character garbled resolution method

Source: Internet
Author: User
Smarty Template Output Character garbled
I created config.conf as a configuration file, I want to use the Smarty template to import and output in the page
Php,html and config.conf are encoded as Utf8,firefox browser Unicode
The page was garbled.

I changed config.conf to ANSI encoding.

I infer that it may be related to the encoding of Smarty itself.
I copied a smarty package from someone else (my own is the latest version from the official website), the page shows normal no garbled.

Config.conf Enter information as follows

Webtitle= Dangdang, the world's largest Chinese online bookstore
copyright= Dangdang
Icpnum = 123456


HTML code





<{config_load file= "config.conf"}>
<{#webTitle #}>




---------Configuration file Demo----------







Copyright <{#copyRight #}> <{#icpNum #}>





PHP code

Require_once ("smarty/smarty.class.php");
$smarty =new smarty ();
$smarty->left_delimiter= "<{";
$smarty->right_delimiter= "}>";
$smarty->display ("index.html");

?>


I would like to ask if you still use the original Smarty package, how to solve the above problems, thank you
------Solution--------------------
Try to change config.conf to Utf-8 code without BOM.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.