如何解决我的PHP网页文件语言编码? [英] How I can solve my PHP web page file language encoding?

查看:144
本文介绍了如何解决我的PHP网页文件语言编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PHP的语言编码中有一个问题,因为我的php文件应该显示英语和阿拉伯字符。

I have a problem in Language Encoding in PHP as my php file should display both English and Arabic Characters.

一些网页部分是静态的,数据来自Sybase数据库)和数据库的语言编码是确定的,因为数据显示得很好。

Some web page parts are static and others are dynamic (data comes from a Sybase database) and the language encoding of database is ok as data is displayed well in it.

我的网页有一些动态的下拉列表,

My web page has some drop down lists that are dynamic but they display the data in a strange format which is not English or Arabic like squares and unknown symbols.

我检查了可能的原因,并做了许多解决方案,如: -

I checked the possible causes and did many solutions like:-


  • 更改PHP脚本的编码:

  • Changing the encoding of the PHP script:

更改HTML编码声明:

Changing the HTML encoding declaration:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />


  • 更改PHP编码声明:

  • Changing the PHP encoding declaration:

    header('Content-Type: text/html; charset=UTF-8);
    header('Content-Type: text/html; charset=windows-1256');
    


  • 更改数据库表字体和语言:

  • Changing the database tables font and language:

    Arial(Arabic).
    


  • 问题仍然存在,我可以做些什么来解决这个问题。

    The problem still exists and I do not know what I can do to solve that.

    你能建议任何解决方案吗?

    Can you suggest any solution?

    推荐答案

    检查数据库连接,确保 sybase_connect 与UTF-8连接为字符集。
    请参见 http://php.net/manual/en/function。 sybase-connect.php

    Check your database connection, make sure the sybase_connect connects with UTF-8 as charset. See http://php.net/manual/en/function.sybase-connect.php

    从使用ODBC连接的注释:似乎PHP / ODBC和UTF8有一个问题。此主题提及了一些建议: Php / ODBC编码问题

    From the comment that you are using ODBC to connect: There seems to be an issue with PHP/ODBC and UTF8. Some suggestions are mentioned in this thread: Php/ODBC encoding problem

    这篇关于如何解决我的PHP网页文件语言编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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