久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='i04zy'><style id='i04zy'><dir id='i04zy'><q id='i04zy'></q></dir></style></legend>

  1. <tfoot id='i04zy'></tfoot>

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

    • <bdo id='i04zy'></bdo><ul id='i04zy'></ul>

    1. <i id='i04zy'><tr id='i04zy'><dt id='i04zy'><q id='i04zy'><span id='i04zy'><b id='i04zy'><form id='i04zy'><ins id='i04zy'></ins><ul id='i04zy'></ul><sub id='i04zy'></sub></form><legend id='i04zy'></legend><bdo id='i04zy'><pre id='i04zy'><center id='i04zy'></center></pre></bdo></b><th id='i04zy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='i04zy'><tfoot id='i04zy'></tfoot><dl id='i04zy'><fieldset id='i04zy'></fieldset></dl></div>

      mySQL 表中的重音字符

      Accented characters in mySQL table(mySQL 表中的重音字符)
        <tbody id='XzTIO'></tbody>

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

          <bdo id='XzTIO'></bdo><ul id='XzTIO'></ul>
          <tfoot id='XzTIO'></tfoot>

            <legend id='XzTIO'><style id='XzTIO'><dir id='XzTIO'><q id='XzTIO'></q></dir></style></legend>
            • <small id='XzTIO'></small><noframes id='XzTIO'>

                本文介紹了mySQL 表中的重音字符的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有一些法語文本(包含重音字符,如é"),存儲在一個 MySQL 表中,其排序規則為 utf8_unicode_ci(表和列),我想在 HTML5 頁面上輸出.

                I have some texts in French (containing accented characters such as "é"), stored in a MySQL table whose collation is utf8_unicode_ci (both the table and the columns), that I want to output on an HTML5 page.

                HTML 頁面字符集是 UTF-8(< meta charset="utf-8"/>),PHP 文件本身被編碼為沒有 BOM 的 UTF-8"(我在 Windows 上使用 Notepad++).我使用 PHP5 請求數據庫并生成 HTML.

                The HTML page charset is UTF-8 (< meta charset="utf-8" />) and the PHP files themselves are encoded as "UTF-8 without BOM" (I use Notepad++ on Windows). I use PHP5 to request the database and generate the HTML.

                但是,在輸出頁面上,特殊字符(如é")出現亂碼,被""代替.

                However, on the output page, the special characters (such as "é") appear garbled and are replaced by "?".

                當我瀏覽數據庫(通過 phpMyAdmin)時,這些相同的重音字符顯示得很好.

                When I browse the database (via phpMyAdmin) those same accented characters display just fine.

                我在這里遺漏了什么?

                (注意:將頁面編碼(通過 Firefox 的Web 開發人員"菜單)更改為 ISO-8859-1 可以解決問題...除了直接出現在 PHP 文件中的特殊字符現在已損壞.但是無論如何,我寧愿了解為什么它不能作為 UTF-8 工作,也不愿在不了解其工作原理的情況下更改編碼.^^;)

                (Note: changing the page encoding (through Firefox's "web developer" menu) to ISO-8859-1 solves the problem... except for the special characters that appears directly in the PHP files, which become now corrupted. But anyway, I'd rather understand why it doesn't work as UTF-8 than changing the encoding without understanding why it works. ^^;)

                推薦答案

                我之前也遇到過同樣的問題,我做了以下事情

                I experienced that same problem before, and what I did are the following

                1) 使用記事本++(幾乎可以適應任何編碼)或 eclipse 并確保在沒有 BOM 的情況下以 UTF-8 保存或打開它.

                1) Use notepad++(can almost adapt on any encoding) or eclipse and be sure in to save or open it in UTF-8 without BOM.

                2) 在 PHP 標頭中設置編碼,使用 header('Content-type: text/html; charset=UTF-8');

                2) set the encoding in PHP header, using header('Content-type: text/html; charset=UTF-8');

                3) 刪除 PHP 文件開頭和結尾的所有多余空格.

                3) remove any extra spaces on the start and end of my PHP files.

                4) 通過 PhpMyAdmin 或您擁有的任何 mySQL 客戶端將我所有的表和列編碼設置為 utf8mb4_general_ciutf8mb4_unicode_ci.兩種編碼的比較可在這里

                4) set all my table and columns encoding to utf8mb4_general_ci or utf8mb4_unicode_ci via PhpMyAdmin or any mySQL client you have. A comparison of the two encodings are available here

                5) 將 mysql 連接字符集設置為 UTF-8(我使用 PDO 作為我的數據庫連接)

                5) set mysql connection charset to UTF-8 (I use PDO for my database connection )

                  PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
                  PDO::MYSQL_ATTR_INIT_COMMAND => "SET CHARACTER SET utf8"
                

                或者在獲取任何數據之前執行 SQL 查詢

                or just execute the SQL queries before fetching any data

                6) 使用元標記 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

                7) 使用某種語言代碼表示法語<meta http-equiv="Content-language" content="fr"/>

                7) use a certain language code for French <meta http-equiv="Content-language" content="fr" />

                8) 將 html 元素的 lang 屬性更改為所需的語言

                8) change the html element lang attribute to the desired language

                <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
                

                并將對此進行更多更新,因為我之前真的很難解決這個問題,因為我在過去的項目中處理日語字符

                and will be updating this more because I really had a hard time solving this problem before because I was dealing with Japanese characters in my past projects

                9) 某些字體在客戶端 PC 中不可用,您需要使用 Google 字體 來包含它在你的 CSS 上

                9) Some fonts are not available in the client PC, you need to use Google fonts to include it on your CSS

                10) 不要以 ?>

                注意:

                但是如果我上面說的一切都不起作用,請嘗試根據您真正想要顯示的字符集調整您的編碼,對我來說,我將所有內容都設置為 SHIFT-JIS 以顯示所有我的日語字符,它真的很好用.但是使用 UFT-8 必須是您的優先事項

                but if everything I said above doesn't work, try to adjust your encoding depending on the character-set you really want to display, for me I set everything to SHIFT-JIS to display all my japanese characters and it really works fine. But using UFT-8 must be your priority

                這篇關于mySQL 表中的重音字符的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                      <tbody id='vp8oG'></tbody>

                  1. <legend id='vp8oG'><style id='vp8oG'><dir id='vp8oG'><q id='vp8oG'></q></dir></style></legend>
                    <i id='vp8oG'><tr id='vp8oG'><dt id='vp8oG'><q id='vp8oG'><span id='vp8oG'><b id='vp8oG'><form id='vp8oG'><ins id='vp8oG'></ins><ul id='vp8oG'></ul><sub id='vp8oG'></sub></form><legend id='vp8oG'></legend><bdo id='vp8oG'><pre id='vp8oG'><center id='vp8oG'></center></pre></bdo></b><th id='vp8oG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vp8oG'><tfoot id='vp8oG'></tfoot><dl id='vp8oG'><fieldset id='vp8oG'></fieldset></dl></div>

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

                    <tfoot id='vp8oG'></tfoot>
                      <bdo id='vp8oG'></bdo><ul id='vp8oG'></ul>

                        1. 主站蜘蛛池模板: 国产成人精品久久 | 黄色网毛片 | 免费av观看 | 亚洲在线视频 | 久久午夜视频 | 人人99| 久久一区二区三区四区 | 国产一级电影在线观看 | 成人国内精品久久久久一区 | 亚洲最新在线 | 欧美精品一区二区三区四区 在线 | 国产精品免费视频一区 | 久久国产精品-国产精品 | 中文字幕免费 | 一区二区三区福利视频 | 久久国产精品99久久久久久丝袜 | 国产精品久久久久久久久久三级 | 免费亚洲一区二区 | 久久精品在线播放 | 网站黄色在线免费观看 | 亚洲人成人一区二区在线观看 | 亚洲国产精品一区二区三区 | 最新国产在线 | 鸳鸯谱在线观看高清 | 国产一区二区久久 | 蜜臀久久99精品久久久久久宅男 | 久久久精| 成人在线免费观看视频 | 超碰97干| 中日韩毛片 | 国产激情视频在线观看 | 欧美高清一区 | 午夜资源 | 国产精品久久久久久久久久三级 | 97色综合| 国产一区二区av | 欧美精品一区二区免费 | 欧美一级毛片免费观看 | 久久免费精品视频 | 午夜精品久久久久久久99黑人 | 激情国产|