![](/img/trans.png)
[英]PHP, XML, DOM — how to make sure that final xml file encoding=utf-8?
[英]How to make sure that php files are actually saved with utf-8 encoding?
我遇到了煩人的php utf8 netbeans編碼問題。 昨天我整晚都在搜索谷歌和StackOverflow尋求解決方案。 我嘗試了很多東西,似乎我無法讓它發揮作用。 我知道我做錯了什么......
我有一個需要打印的法國caracters像PHP項目é è ç à
但不是信其輸出
我把它添加到我的文件中:
<!DOCTYPE html>
<html>
<?php
header('Content-type: text/html; charset=utf-8');
?>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
</head>
一些用戶建議通過在此行添加-J-Dfile.encoding=UTF-8
來修改neatbeans.conf
netbeans_default_options
問題仍然存在......
我右鍵單擊了項目 - > properties - > sources,我的編碼設置為windows-1252
我試圖將其更改為UTF-8但是它給了我這個警告: Changing to UTF-8 may cause some files to be unreadable. Would you like to continue>
Changing to UTF-8 may cause some files to be unreadable. Would you like to continue>
我點擊了是,但問題仍然存在......
那么如何確保我的文件以UTF-8編碼? 請輕松的方式。
我為解決這類問題所做的工作是:
iconv("ISO-8859-1", "UTF-8", $value);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.