pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

        <tfoot id='BrzFF'></tfoot>
        <legend id='BrzFF'><style id='BrzFF'><dir id='BrzFF'><q id='BrzFF'></q></dir></style></legend>
      1. <i id='BrzFF'><tr id='BrzFF'><dt id='BrzFF'><q id='BrzFF'><span id='BrzFF'><b id='BrzFF'><form id='BrzFF'><ins id='BrzFF'></ins><ul id='BrzFF'></ul><sub id='BrzFF'></sub></form><legend id='BrzFF'></legend><bdo id='BrzFF'><pre id='BrzFF'><center id='BrzFF'></center></pre></bdo></b><th id='BrzFF'></th></span></q></dt></tr></i><div class="2wc2o2w" id='BrzFF'><tfoot id='BrzFF'></tfoot><dl id='BrzFF'><fieldset id='BrzFF'></fieldset></dl></div>
      2. PHP 文件中的 UTF-8 BOM 簽名

        UTF-8 BOM signature in PHP files(PHP 文件中的 UTF-8 BOM 簽名)
      3. <legend id='05vew'><style id='05vew'><dir id='05vew'><q id='05vew'></q></dir></style></legend>

        <small id='05vew'></small><noframes id='05vew'>

          • <bdo id='05vew'></bdo><ul id='05vew'></ul>
              <tbody id='05vew'></tbody>

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

                  <tfoot id='05vew'></tfoot>
                  本文介紹了PHP 文件中的 UTF-8 BOM 簽名的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在編寫一些帶注釋的 PHP 類時偶然發現了一個問題.我的名字(對于@author 標簽)以 ?(這是一個 UTF-8 字符,...還有一個奇怪的名字,我知道)結束.

                  I was writing some commented PHP classes and I stumbled upon a problem. My name (for the @author tag) ends up with a ? (which is a UTF-8 character, ...and a strange name, I know).

                  即使我將文件保存為 UTF-8,一些朋友報告說他們看到該字符完全混亂 (è?).通過添加 BOM 簽名,這個問題就消失了.但那件事讓我有點困擾,因為我對此知之甚少,除了我在 Wikipedia 上看到的內容以及 SO 上的其他一些類似問題.

                  Even though I save the file as UTF-8, some friends reported that they see that character totally messed up (è?). This problem goes away by adding the BOM signature. But that thing troubles me a bit, since I don't know that much about it, except from what I saw on Wikipedia and on some other similar questions here on SO.

                  我知道它在文件的開頭添加了一些東西,據我所知,它并沒有那么糟糕,但我很擔心,因為我讀到的唯一有問題的場景涉及 PHP 文件.由于我正在編寫 PHP 類來共享它們,因此 100% 兼容比在評論中顯示我的名字更重要.

                  I know that it adds some things at the beginning of the file, and from what I understood it's not that bad, but I'm concerned because the only problematic scenarios I read about involved PHP files. And since I'm writing PHP classes to share them, being 100% compatible is more important than having my name in the comments.

                  但我正在嘗試了解其含義,我應該使用它而不用擔心嗎?或者是否有可能造成損壞的情況?什么時候?

                  But I'm trying to understand the implications, should I use it without worrying? or are there cases when it might cause damage? When?

                  推薦答案

                  確實,BOM 是發送到瀏覽器的實際數據.瀏覽器會很樂意忽略它,但您仍然無法發送標頭.

                  Indeed, the BOM is actual data sent to the browser. The browser will happily ignore it, but still you cannot send headers then.

                  我相信問題確實出在您和您朋友的編輯器設置上.如果沒有 BOM,您朋友的編輯器可能不會自動將文件識別為 UTF-8.他可以嘗試設置他的編輯器,使編輯器期望一個文件為 UTF-8(如果您使用真正的 IDE,例如 NetBeans,那么這甚至可以成為一個項目設置,您可以隨code一起轉).

                  I believe the problem really is your and your friend's editor settings. Without a BOM, your friend's editor may not automatically recognize the file as UTF-8. He can try to set up his editor such that the editor expects a file to be in UTF-8 (if you use a real IDE such as NetBeans, then this can even be made a project setting that you can transfer along with the code).

                  另一種方法是嘗試一些技巧:一些編輯器嘗試根據輸入的文本使用一些啟發式方法來確定編碼.你可以嘗試用

                  An alternative is to try some tricks: some editors try to determine the encoding using some heuristics based on the entered text. You could try to start each file with

                  <?php //úτ?-8 encoded
                  

                  也許啟發式會得到它.可能有更好的東西可以放在那里,你可以谷歌搜索什么樣的編碼檢測啟發式是常見的,或者只是嘗試一些:-)

                  and maybe the heuristic will get it. There's probably better stuff to put there, and you can either google for what kind of encoding detection heuristics are common, or just try some out :-)

                  總而言之,我建議只修復編輯器設置.

                  All in all, I recommend just fixing the editor settings.

                  哦等等,我誤讀了最后一部分:為了將代碼傳播到任何地方,我想你最安全的方法是讓所有文件只包含低 7 位字符,即純 ASCII,或者只是接受一些人古代編輯看到你寫的名字很有趣.沒有萬無一失的方法.由于標題已經發送,BOM 肯定是壞的.另一方面,只要你只在注釋中放 UTF-8 字符等等,一些編輯誤解編碼的唯一影響就是奇怪的字符.我會正確拼寫您的名字并添加針對啟發式的評論,以便大多數編輯都能理解,但總會有人看到虛假字符.

                  Oh wait, I misread the last part: for spreading the code to anywhere, I guess you're safest just making all files only contain the lower 7-bit characters, i.e. plain ASCII, or to just accept that some people with ancient editors see your name written funny. There is no fail-safe way. The BOM is definitely bad because of the headers already sent thing. On the other side, as long as you only put UTF-8 characters in comments and so, the only impact of some editor misunderstanding the encoding is weird characters. I'd go for correctly spelling your name and adding a comment targeted at heuristics so that most editors will get it, but there will always be people who'll see bogus chars instead.

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

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

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

                            <legend id='owZbE'><style id='owZbE'><dir id='owZbE'><q id='owZbE'></q></dir></style></legend>
                            主站蜘蛛池模板: 缝纫客| 紫外线老化试验箱_uv紫外线老化试验箱价格|型号|厂家-正航仪器设备 | 佛山市钱丰金属不锈钢蜂窝板定制厂家|不锈钢装饰线条|不锈钢屏风| 电梯装饰板|不锈钢蜂窝板不锈钢工艺板材厂家佛山市钱丰金属制品有限公司 | 全自动端子机|刺破式端子压接机|全自动双头沾锡机|全自动插胶壳端子机-东莞市傅氏兄弟机械设备有限公司 | 网站优化公司_SEO优化_北京关键词百度快速排名-智恒博网络 | 合肥钣金加工-安徽激光切割加工-机箱机柜加工厂家-合肥通快 | 泰国专线_泰国物流专线_广州到泰国物流公司-泰廊曼国际 | 袋式过滤器,自清洗过滤器,保安过滤器,篮式过滤器,气体过滤器,全自动过滤器,反冲洗过滤器,管道过滤器,无锡驰业环保科技有限公司 | 十字轴_十字轴万向节_十字轴总成-南京万传机械有限公司 | 影像测量仪_三坐标测量机_一键式二次元_全自动影像测量仪-广东妙机精密科技股份有限公司 | 拖鞋定制厂家-品牌拖鞋代加工厂-振扬实业中国高端拖鞋大型制造商 | 旋振筛|圆形摇摆筛|直线振动筛|滚筒筛|压榨机|河南天众机械设备有限公司 | 鲁尔圆锥接头多功能测试仪-留置针测试仪-上海威夏环保科技有限公司 | 酒店厨房设计_中央厨房设计_北京商用厨房设计公司-奇能商厨 | POM塑料_PBT材料「进口」聚甲醛POM杜邦原料、加纤PBT塑料报价格找利隆塑料 | 退火炉,燃气退火炉,燃气热处理炉生产厂家-丹阳市丰泰工业炉有限公司 | 玉米深加工机械,玉米加工设备,玉米加工机械等玉米深加工设备制造商-河南成立粮油机械有限公司 | bng防爆挠性连接管-定做金属防爆挠性管-依客思防爆科技 | BESWICK球阀,BESWICK接头,BURKERT膜片阀,美国SEL继电器-东莞市广联自动化科技有限公司 | 超声波乳化机-超声波分散机|仪-超声波萃取仪-超声波均质机-精浩机械|首页 | 步进_伺服_行星减速机,微型直流电机,大功率直流电机-淄博冠意传动机械 | 儿童乐园|游乐场|淘气堡招商加盟|室内儿童游乐园配套设备|生产厂家|开心哈乐儿童乐园 | 广州印刷厂_广州彩印厂-广州艺彩印务有限公司 | 厚壁钢管-厚壁无缝钢管-小口径厚壁钢管-大口径厚壁钢管 - 聊城宽达钢管有限公司 | 苏州同创电子有限公司 - 四探针测试仪源头厂家 | 赛默飞Thermo veritiproPCR仪|ProFlex3 x 32PCR系统|Countess3细胞计数仪|371|3111二氧化碳培养箱|Mirco17R|Mirco21R离心机|仟诺生物 | 诗词大全-古诗名句 - 古诗词赏析 | 干粉砂浆设备_干混砂浆生产线_腻子粉加工设备_石膏抹灰砂浆生产成套设备厂家_干粉混合设备_砂子烘干机--郑州铭将机械设备有限公司 | 隧道风机_DWEX边墙风机_SDS射流风机-绍兴市上虞科瑞风机有限公司 | 北京网站建设-企业网站建设-建站公司-做网站-北京良言多米网络公司 | 展厅设计公司,展厅公司,展厅设计,展厅施工,展厅装修,企业展厅,展馆设计公司-深圳广州展厅设计公司 | 碳纤维复合材料制品生产定制工厂订制厂家-凯夫拉凯芙拉碳纤维手机壳套-碳纤维雪茄盒外壳套-深圳市润大世纪新材料科技有限公司 | 浇钢砖,流钢砖_厂家价低-淄博恒森耐火材料有限公司 | 南溪在线-南溪招聘找工作、找房子、找对象,南溪综合生活信息门户! | 赛默飞Thermo veritiproPCR仪|ProFlex3 x 32PCR系统|Countess3细胞计数仪|371|3111二氧化碳培养箱|Mirco17R|Mirco21R离心机|仟诺生物 | 冷却塔改造厂家_不锈钢冷却塔_玻璃钢冷却塔改造维修-广东特菱节能空调设备有限公司 | 成都热收缩包装机_袖口式膜包机_高速塑封机价格_全自动封切机器_大型套膜机厂家 | 我爱古诗词_古诗词名句赏析学习平台 | QQ房产导航-免费收录优秀房地产网站_房地产信息网 | elisa试剂盒-PCR试剂盒「上海谷研实业有限公司」 | 精密机械零件加工_CNC加工_精密加工_数控车床加工_精密机械加工_机械零部件加工厂 |