Smarty Template Output Character garbled

Source: Internet
Author: User
Tags smarty template
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
 
  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


Reply to discussion (solution)

Try to change config.conf to Utf-8 code without BOM.

Try to change config.conf to Utf-8 code without BOM.



Thanks for upstairs! I read some of the posts, using Notepad to save the BOM, and PHP is not support BOM, will lead to errors.
Finally, I use PHP to save PHP files, modify the suffix, error correction.
  • 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.