Ask how to obtain data from the database on a simple UTF-8 page. the Chinese characters are question marks, and the methods used cannot be HTMLcode & lt ;! DOCTYPEhtmlPUBLIC & quot;-W3CDTDXHTML1.0TransitionalEN & quot; www. w3.orgTRxhtml1DTDxhtml1-transit ask how to obtain data from the database in a simple UTF-8 page. Chinese characters are question marks, and no way can be
HTML code
Chinese garbled characters
Table 1
Now Table 1 in p can be normally displayed, that is, the Chinese characters of the data extracted from the database are changed to question marks, and English is also normal.
------ Solution --------------------
1. query ("set names 'utf8'") before the database retrieves data. Note that the database encoding must also be SET to UTF8.
2. file encoding in UTF-8 format
3. add in php
Header ('content-Type: text/html; charset = UTF-8 ');
Over. for short, the three codes are the same...