【发布时间】:2016-09-26 11:14:13
【问题描述】:
我遇到了一个烦人的 php utf8 netbeans 编码问题。昨天我花了一整夜在谷歌和 StackOverflow 上搜索解决方案。我尝试了很多东西,似乎我无法让它工作。我知道我做错了什么......
我有一个 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>
部分用户建议修改neatbeans.conf,在此行添加-J-Dfile.encoding=UTF-8netbeans_default_options
问题依然存在……
我右键单击项目 -> 属性 -> 来源,我的编码设置为 windows-1252 我试图将其更改为 UTF-8 但它给了我这个警告:Changing to UTF-8 may cause some files to be unreadable. Would you like to continue>
我点击是,但问题仍然存在......
那么如何确保我的文件以 UTF-8 编码?请用简单的方法。
【问题讨论】:
标签: php encoding utf-8 character-encoding netbeans-8