UTF-8 Headaches Access to mySQL/PHP

后端 未结 1 358
再見小時候
再見小時候 2020-12-22 06:11

My mySQL database create shows

CREATE DATABASE `foo` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */ 

The mySQL field collat

相关标签:
1条回答
  • 2020-12-22 07:09

    The issue was resolved by adding these queries to the connection:

    mysql_query("SET collation_connection = utf8_unicode_ci");
    mysql_query("SET NAMES utf8;");
    

    And THEN a call to utf8_encode() wrapping the output.

    The function call ought not be needed given all of the headers and Content-Type settings...?

    0 讨论(0)
提交回复
热议问题