This utf-8 simple page, how to take the data from the database Chinese is a question mark, the test method is not

Source: Internet
Author: User
Ask this utf-8 simple page, how to take the data from the database Chinese is a question mark, the test method is not
HTML Code
  
   
  
   Chinese garbled
  
   Table 1
  
   
   


Now the div "Table 1" can be displayed normally, that is, the data extracted from the database Chinese question mark, English is normal

------Solution--------------------
1. The database before the data query ("SET NAMES ' UTF8 '), note that the database related coding also needs to be set to UTF8
2. File encoding for UTF-8 format Note that the file is encoded
3. Add in PHP

Header (' content-type:text/html; Charset=utf-8 ');

Over. Abbreviation three yards consistent ...
  • 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.