使用UTF8编码阿拉伯语 [英] Encoding arabic using UTF8
问题描述
目前我使用包括系统创建简单的网站
-
header.php - 包含HTML页面的第一部分(Head,meta标签,JS代码等)
-
page.php - 包含简单的PHP代码
页面内容
我阿拉伯语言的主要问题
我必须把
< meta http-equiv =Content-Typecontent =text / html; charset = UTF-8\" />
in page.php,footer.php between < head>
标签,否则阿拉伯语将无法正确支持。
由于这些标签,这可以防止页面验证。
有没有办法避免这个问题?
谢谢
-
然后使用utf8_decode()对字符串进行解码。 p>
示例:
<?php echo utf8_decode('your_encoded_string_goes_here'); ?>
Currently I created simple website using include system
header.php - contains first part of HTML page (Head, meta tags, JS codes ... etc )
page.php - contains simple php code
page content
My main problem with arabic language
I have to put
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
in page.php, footer.php between <head>
tags otherwise the arabic will not support correctly.
This prevents page validation because of these tags.
Is there any method to avoid this problem ?
Thanks
Encode the arabic string into UTF-8 using a tool like this. (No need to change any settings - that link has the the correct settings you need).
Then use utf8_decode() to decode the string back.
Example:
<?php echo utf8_decode('your_encoded_string_goes_here'); ?>
这篇关于使用UTF8编码阿拉伯语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!