简体   繁体   中英

Special characters not showing on the web page after set to charset=UTF8

I have an app that developed with JS, PHP and for some reason it is not able to display the Spanish Accents in the dropdown box which the values are from the mysql table. For the same app, it display those Spanish accents without any problem on the windows web server IIS 8.5, but not in the Linux box which running REL 6.5 with apache 2.2 installed.

Here are what I did try and checked.

The charset=UTF-8 already set in the meta header in the html. The php.ini on both servers are set default to UTF-8

Default charset for Apache config file is set to UTF-8.

Checked the locale setting on Linux box to make sure include the es-UTF8 in the sysconfig.

Checked the chrome dev tool by inspect the response header and the content-type showing plain/html , charset=UTF-8, vary: accept encoding.

If I go into the phpMyAdmin and look at the raw table, the accents are stored in the MySQL table and I can search it too inside phpMyAdmin.

在执行实际查询之前,请在查询下面运行:

mysqli_query($con, 'SET names UTF8');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM