使用UTF8编码阿拉伯语 [英] Encoding arabic using UTF8

查看:689
本文介绍了使用UTF8编码阿拉伯语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我使用包括系统创建简单的网站


  1. header.php - 包含HTML页面的第一部分(Head,meta标签,JS代码等)


  2. page.php - 包含简单的PHP代码




    页面内容

我阿拉伯语言的主要问题



我必须把

 < meta http-equiv =Content-Typecontent =text / html; charset = UTF-8\" /> 

in page.php,footer.php between < head> 标签,否则阿拉伯语将无法正确支持。



由于这些标签,这可以防止页面验证。



有没有办法避免这个问题?



谢谢

解决方案


  1. 使用工具这样一个工具将阿拉伯字符串编码成UTF-8 / A>。 (无需更改任何设置 - 该链接具有所需的正确设置)。


  2. 然后使用utf8_decode()对字符串进行解码。 p>


示例:

 <?php echo utf8_decode('your_encoded_string_goes_here'); ?> 


Currently I created simple website using include system

  1. header.php - contains first part of HTML page (Head, meta tags, JS codes ... etc )

  2. 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

解决方案

  1. 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).

  2. Then use utf8_decode() to decode the string back.

Example:

<?php echo utf8_decode('your_encoded_string_goes_here'); ?>

这篇关于使用UTF8编码阿拉伯语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆