英语/阿拉伯语编码问题
我正在设计一个网页,这个网页应该支持
英语和阿拉伯语,
我的问题是:阿拉伯字符没有以它的方式出现,
它看起来像这样“أهلاٴ يا Ù…Ø1Ù “Ù…”
我尝试使用以下标签更改此页面的编码
<META CONTENT="text/html; charset=windows-1256" HTTP-EQUIV="Content-Type">
,但它不起作用,我尝试了“utf-8”,但它也不起作用?
感谢您阅读我的问题
I am designing a web page this web page should support
English and Arabic languages
my problem is : Arabic characters doesn't appear in its way
it appears some thing like that "أهلاً يا معلم "
I have tried to change the encoding of this page with the following tag
<META CONTENT="text/html; charset=windows-1256" HTTP-EQUIV="Content-Type">
but it didn't work and I tried the "utf-8" but it doesn't work either?
thanks for reading my question
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您需要进行的更改还不止于此:理想情况下,所有内容都应设置为 UTF-8 或以 UTF-8 编码:
对于最后一部分,这应该可以解决问题,在 PHP 中:
(您可能需要调整它,具体取决于您的...内容类型 ^^ )
You need to change more than that : ideally, everything should be set to, or encoded in, UTF-8 :
For the last part, this should do the trick, in PHP :
(You might need to adjust it, depending on your... content-type ^^ )
你的问题的答案肯定是UTF-8。
作为良好的基础读物,我推荐 《每个软件开发人员绝对、肯定必须了解 Unicode 和字符的绝对最低要求》集合(没有借口!)
如果您需要此处更详细的帮助,您必须描述您到底做什么:您的数据来自哪里,您是否使用 CMS 等等。 (更新:@Pascal Martin 已经提到了所有要点)。
The answer to your question is most certainly UTF-8.
As good basic reading, I recommend The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
If you want more detailed help here, you will have to describe what exactly you do: Where your data comes from, whether you use a CMS and so on. (Update: @Pascal Martin already mentioned all the important points).
这是我使用的防弹方法。首先指示 PHP 始终处理 UTF8:
然后仔细检查浏览器是否知道我们正在使用 UTF 方案:
Here's the bulletproof way I use. First instruct PHP to deal with UTF8 all the way:
Then double-check that the browser knows that we're using the UTF scheme:
使用
meta
方法将页面的编码设置为 UTF-8,并确保您的文件以 UTF-8 格式保存(在编辑器中,检查使用的编码是否为 UTF-8)。Set your page's encoding to UTF-8 using the
meta
method and make sure your files are saved in UTF-8 (in your editor, check that the encoding used is UTF-8).尝试将此
AddDefaultCharset UTF-8
添加到您的 .htacess 文件Try add this
AddDefaultCharset UTF-8
to your .htacess file您需要使用编码(UTF-8)保存 php 文件。
you need to save php file with encoding (UTF-8).