问号字符显示在文本中.为什么是这样? [英] Question mark characters display within text. Why is this?

查看:47
本文介绍了问号字符显示在文本中.为什么是这样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个备份服务器,可以自动备份我的实时站点,包括文件和数据库.

I have a backup server that automatically backs up my live site, both files and database.

在实时站点上,文本看起来不错,但是当您查看它的镜像版本时,它显示?"在一些文本中.此文本存储在新闻数据库表中.

On the live site, the text looks fine, but when you view the mirrored version of it, it displays '?' within some of the text. This text is stored within the news database table.

这是它在实时服务器和镜像服务器上的屏幕截图.

Here is a screenshot of it being on the live server and of it on the mirrored server.

在将其备份到镜像服务器的过程中会发生什么?

What could happen within the process of backing it up to the mirrored server?

直播服务器是Solaris,镜像服务器是Linux Red Hat Linux 5.

The live server is Solaris, and the mirrored server is Linux Red Hat Linux 5.

推荐答案

以下文章会很有用:

10.3 指定字符集和排序规则

10.4 连接字符集和排序规则

连接到数据库后,发出以下命令:

After you connect to the database, issue the following command:

SET NAMES 'utf8';

确保您的网页也使用 UTF-8 编码:

Ensure that your web page also uses the UTF-8 encoding:

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

PHP 还提供了几个对转换有用的函数:

PHP also offers several functions that will be useful for conversions:

这篇关于问号字符显示在文本中.为什么是这样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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