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

  • <small id='xk7dG'></small><noframes id='xk7dG'>

    1. <legend id='xk7dG'><style id='xk7dG'><dir id='xk7dG'><q id='xk7dG'></q></dir></style></legend>

        <tfoot id='xk7dG'></tfoot>

        <i id='xk7dG'><tr id='xk7dG'><dt id='xk7dG'><q id='xk7dG'><span id='xk7dG'><b id='xk7dG'><form id='xk7dG'><ins id='xk7dG'></ins><ul id='xk7dG'></ul><sub id='xk7dG'></sub></form><legend id='xk7dG'></legend><bdo id='xk7dG'><pre id='xk7dG'><center id='xk7dG'></center></pre></bdo></b><th id='xk7dG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xk7dG'><tfoot id='xk7dG'></tfoot><dl id='xk7dG'><fieldset id='xk7dG'></fieldset></dl></div>
          <bdo id='xk7dG'></bdo><ul id='xk7dG'></ul>
      1. PHP 中的 UTF8 文件名和不同的 Unicode 編碼

        UTF8 Filenames in PHP and Different Unicode Encodings(PHP 中的 UTF8 文件名和不同的 Unicode 編碼)
          <tbody id='haRaD'></tbody>

          <bdo id='haRaD'></bdo><ul id='haRaD'></ul>

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

              1. <tfoot id='haRaD'></tfoot>
                • <small id='haRaD'></small><noframes id='haRaD'>

                  本文介紹了PHP 中的 UTF8 文件名和不同的 Unicode 編碼的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在運行 linux 的服務器上有一個包含 Unicode 字符的文件.如果我通過 SSH 連接到服務器并使用制表符完成導航到包含 unicode 字符的文件/文件夾,則訪問該文件/文件夾沒有問題.當我嘗試通過 PHP 訪問文件時出現問題(我訪問文件系統的函數是 stat).如果我將 PHP 腳本生成的路徑輸出到瀏覽器并將其粘貼到終端中,該文件似乎也存在(即使在終端中查看文件路徑完全相同).

                  我通過 php_ini 將 PHP 設置為使用 UTF8 作為其默認編碼,并設置了 mb_internal_encoding.我檢查了 PHP 文件路徑字符串編碼,它應該是 UTF8.再仔細研究一下,我決定 hexdump 終端制表符完成的 é 字符,并將其與 PHP 腳本創建的常規"é 字符的 hexdump 進行比較或通過鍵盤手動輸入字符(在 os x 上為 option+e+e).結果如下:

                  <前>回聲 -né |十六進制轉儲0000000 cc65 00810000003回聲 -né |十六進制轉儲0000000 a9c30000002

                  允許在終端中正確引用文件的 é 字符是 3 字節字符.我不確定從哪里開始,我應該在 PHP 中使用什么編碼?我應該通過 iconvmb_convert_encoding 將路徑轉換為另一種編碼嗎?

                  解決方案

                  多虧了兩個答案中給出的提示,我能夠四處探索并找到一些方法來規范化給定字符的不同 unicode 分解.在我遇到的情況下,我正在訪問由 OS X Carbon 應用程序創建的文件.這是一個相當流行的應用程序,因此它的文件名似乎遵循特定的 unicode 分解.

                  在 PHP 5.3 中引入了一個 新的函數集,允許您可以將 unicode 字符串規范化為特定的分解.顯然,您可以將 unicode 字符串分解為四種分解標準.Python 從 2.3 版開始通過 unicode.normalize 具有 unicode 規范化功能.這篇文章關于python對unicode字符串的處理有助于理解編碼/字符串處理好一點.

                  以下是規范化 unicode 文件路徑的快速示例:

                  filePath = unicodedata.normalize('NFD', filePath)

                  我發現 NFD 格式適用于我的所有目的,我想知道這是否是 unicode 文件名的標準分解.

                  I have a file containing Unicode characters on a server running linux. If I SSH into the server and use tab-completion to navigate to the file/folder containing unicode characters I have no problem accessing the file/folder. The problem arises when I try accessing the file via PHP (the function I was accessing the file system from was stat). If I output the path generated by the PHP script to the browser and paste it into the terminal the file also seems to exist (even though looking at the terminal the file paths are exactly the same).

                  I set PHP to use UTF8 as its default encoding via php_ini as well as set mb_internal_encoding. I checked the PHP filepath string encoding and it comes out as UTF8, as it should. Poking around a bit more I decided to hexdump the é character that the terminal's tab-completion and compare it to the hexdump of the 'regular' é character created by the PHP script or by manually entering in the character via keyboard (option+e+e on os x). Here is the result:

                  echo -n é | hexdump
                  0000000 cc65 0081                              
                  0000003
                  echo -n é | hexdump
                  0000000 a9c3                                   
                  0000002
                  

                  The é character that allows a correct file reference in the terminal is the 3-byte one. I'm not sure where to go from here, what encoding should I use in PHP? Should I be converting the path to another encoding via iconv or mb_convert_encoding?

                  解決方案

                  Thanks to the tips given in the two answers I was able to poke around and find some methods for normalizing the different unicode decompositions of a given character. In the situation I was faced with I was accessing files created by a OS X Carbon application. It is a fairly popular application and thus its file names seemed to adhere to a specific unicode decomposition.

                  In PHP 5.3 a new set of functions was introduced that allows you to normalize a unicode string to a particular decomposition. Apparently there are four decomposition standards which you can decompose you unicode string into. Python has had unicode normalization capabilties since version 2.3 via unicode.normalize. This article on python's handling of unicode strings was helpful in understanding encoding / string handling a bit better.

                  Here is a quick example on normalizing a unicode filepath:

                  filePath = unicodedata.normalize('NFD', filePath)
                  

                  I found that the NFD format worked for all my purposes, I wonder if this is this is the standard decomposition for unicode filenames.

                  這篇關于PHP 中的 UTF8 文件名和不同的 Unicode 編碼的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)

                    <bdo id='AaM0d'></bdo><ul id='AaM0d'></ul>

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

                        1. <tfoot id='AaM0d'></tfoot>
                              <tbody id='AaM0d'></tbody>
                            <legend id='AaM0d'><style id='AaM0d'><dir id='AaM0d'><q id='AaM0d'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 欧美一区二区三区在线观看视频 | 一级亚洲| 日韩免费视频一区二区 | av高清| 亚洲一区二区三区在线视频 | av网址在线 | 日韩中出 | 伊人网在线看 | 欧美精品一区二区三区在线 | 99精品一区二区 | 成人亚洲视频 | 91精品国产手机 | 99久久精品国产毛片 | 亚洲 欧美 日韩 精品 | 欧美成人手机在线 | 91网站在线看 | 欧产日产国产精品v | 成人小视频在线免费观看 | 国产视频在线观看一区二区三区 | 亚洲午夜在线 | 色偷偷人人澡人人爽人人模 | 欧美精品一区久久 | 亚洲一区二区三区免费在线 | 久久狠狠 | 国产成人免费 | 91pao对白在线播放 | av天天干 | 精品国产18久久久久久二百 | 四虎最新视频 | 久久久夜色精品亚洲 | 日本不卡一区 | 精品一级毛片 | 亚洲免费在线观看 | 黄色av网站免费看 | 国产91丝袜在线播放 | www狠狠爱com | 日韩中文一区二区三区 | 男女羞羞视频在线免费观看 | 国产黄色大片在线观看 | 人人澡人人射 | 亚洲伊人久久综合 |