dongxin1980 2009-12-10 19:57
浏览 70

英语/阿拉伯语编码问题

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

  • 写回答

6条回答 默认 最新

  • dtlab08822 2009-12-10 20:00
    关注

    You need to change more than that : ideally, everything should be set to, or encoded in, UTF-8 :

    • the source code of your scripts / pages
      • configuring your IDE / editor to encode in UTF-8 by default might be a good idea, here
    • the data in your database -- if you are using one
      • the connection between PHP and your DB
    • the meta tag, like you did -- eventually ; not sure it's that usefull, actually
    • the HTTP Content-type header (see point 14.17 or the RFC, for instance)
    • well, everything.

    For the last part, this should do the trick, in PHP :

    header('Content-type: text/html; charset=UTF-8');
    

    (You might need to adjust it, depending on your... content-type ^^ )

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测