• <legend id='d67dv'><style id='d67dv'><dir id='d67dv'><q id='d67dv'></q></dir></style></legend>
    <tfoot id='d67dv'></tfoot>

      <small id='d67dv'></small><noframes id='d67dv'>

        <i id='d67dv'><tr id='d67dv'><dt id='d67dv'><q id='d67dv'><span id='d67dv'><b id='d67dv'><form id='d67dv'><ins id='d67dv'></ins><ul id='d67dv'></ul><sub id='d67dv'></sub></form><legend id='d67dv'></legend><bdo id='d67dv'><pre id='d67dv'><center id='d67dv'></center></pre></bdo></b><th id='d67dv'></th></span></q></dt></tr></i><div id='d67dv'><tfoot id='d67dv'></tfoot><dl id='d67dv'><fieldset id='d67dv'></fieldset></dl></div>
          <bdo id='d67dv'></bdo><ul id='d67dv'></ul>
      1. UTF-8 问题 PHP/MySQL

        时间:2023-10-03

        <i id='PkkAa'><tr id='PkkAa'><dt id='PkkAa'><q id='PkkAa'><span id='PkkAa'><b id='PkkAa'><form id='PkkAa'><ins id='PkkAa'></ins><ul id='PkkAa'></ul><sub id='PkkAa'></sub></form><legend id='PkkAa'></legend><bdo id='PkkAa'><pre id='PkkAa'><center id='PkkAa'></center></pre></bdo></b><th id='PkkAa'></th></span></q></dt></tr></i><div id='PkkAa'><tfoot id='PkkAa'></tfoot><dl id='PkkAa'><fieldset id='PkkAa'></fieldset></dl></div>
      2. <legend id='PkkAa'><style id='PkkAa'><dir id='PkkAa'><q id='PkkAa'></q></dir></style></legend>
            <tbody id='PkkAa'></tbody>
          <tfoot id='PkkAa'></tfoot>

              <bdo id='PkkAa'></bdo><ul id='PkkAa'></ul>
            • <small id='PkkAa'></small><noframes id='PkkAa'>

                  本文介绍了UTF-8 问题 PHP/MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我一直使用 ISO-8859-1 编码,但我现在转而使用 UTF-8.

                  I've always used ISO-8859-1 encoding, but I'm now going over to UTF-8.

                  不幸的是,我无法让它工作.

                  Unfortunately I can't get it to work.

                  我的 MySQL 数据库是 UTF-8,我的 PHP 文档是用 UTF-8 编码的,我设置了一个 UTF-8 字符集,但它仍然不起作用.

                  My MySQL DB is UTF-8, my PHP document is encoded in UTF-8, I set a UTF-8 charset, but it still doesn't work.

                  (像 æ/ø/å 这样的特殊字符不起作用)

                  (it is special characters like æ/ø/å that doesn't work)

                  希望大家帮帮忙!

                  推荐答案

                  确保与数据库的连接也使用此字符集:

                  Make sure the connection to your database is also using this character set:

                  $conn = mysql_connect($server, $username, $password);
                  mysql_set_charset("UTF8", $conn);
                  

                  根据 php.net 的 mysql_set_charset 文档:

                  According to the documentation of mysql_set_charset at php.net:

                  Note:
                  This is the preferred way to change the charset. Using mysql_query() to execute 
                  SET NAMES .. is not recommended.
                  

                  另见:http://nl3.php.net/manual/en/function.mysql-set-charset.php

                  检查您当前连接的字符集:

                  Check the character set of your current connection with:

                  echo mysql_client_encoding($conn);
                  

                  另见:http://nl3.php.net/manual/en/function.mysql-client-encoding.php

                  如果您完成了这些操作并在表格中添加了奇怪的字符,您会看到它显示正确.

                  If you have done these things and add weird characters to your table, you will see it is displayed correct.

                  这篇关于UTF-8 问题 PHP/MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:PHP Curl UTF-8 字符集 下一篇:PHP mysql 字符集 utf8 问题

                  相关文章

                  最新文章

                  <legend id='9A2QQ'><style id='9A2QQ'><dir id='9A2QQ'><q id='9A2QQ'></q></dir></style></legend>

                1. <small id='9A2QQ'></small><noframes id='9A2QQ'>

                  <i id='9A2QQ'><tr id='9A2QQ'><dt id='9A2QQ'><q id='9A2QQ'><span id='9A2QQ'><b id='9A2QQ'><form id='9A2QQ'><ins id='9A2QQ'></ins><ul id='9A2QQ'></ul><sub id='9A2QQ'></sub></form><legend id='9A2QQ'></legend><bdo id='9A2QQ'><pre id='9A2QQ'><center id='9A2QQ'></center></pre></bdo></b><th id='9A2QQ'></th></span></q></dt></tr></i><div id='9A2QQ'><tfoot id='9A2QQ'></tfoot><dl id='9A2QQ'><fieldset id='9A2QQ'></fieldset></dl></div>
                  <tfoot id='9A2QQ'></tfoot>

                    • <bdo id='9A2QQ'></bdo><ul id='9A2QQ'></ul>