简体   繁体   English

非拉丁字符的麻烦

[英]trouble with non-latin characters

I'm having some trouble with my page. 我的页面出现问题。 I have moved my site from a host provider to another one, and now i'm having some problems with non-latin characters, for text that comes from db query and for text that is in html/php file. 我已经将网站从主机提供商转移到了另一个主机提供商,现在我遇到了非拉丁字符的问题,即来自数据库查询的文本和位于html / php文件中的文本。 For text that comes from db someone suggested me to apply this after db connection: 对于来自数据库的文本,有人建议我在数据库连接后应用它:

mysql_query("SET CHARACTER SET utf8");
    mysql_query("SET NAMES utf8");

and it did the trick, but, now i'm having the same problem for texts that comes from html/php files: instead of ë or ç appears I'm sure that should be e trick someone on the server or somewhere else on the configuration. 它确实可以解决问题,但是现在我对来自html / php文件的文本也遇到了同样的问题:代替了ë或ç出现。我敢肯定这应该是在欺骗服务器上的某个人或其他地方的人配置。 Hope that you can help me. 希望你能帮助我。

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

i'm using at the header of my file. 我正在使用文件的标题。

您必须在<head>部分中包含以下行:

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

utf8_general_ci中存储数据的数据库的排序规则吗?

Maybe there was a problem while transfering the files. 传输文件时可能出现问题。

If you are familiar with Linux, try to fix the broken files on your server with recode (excerpt: "The Recode library converts files between character sets and usages.") 如果您熟悉Linux,请尝试使用重新编码来修复服务器上损坏的文件(摘录:“ 重新编码库在字符集和用法之间转换文件。”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM