希腊字符问题 [英] Problem with Greek characters

查看:78
本文介绍了希腊字符问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我的php和mysql项目有问题。

我使用拍卖软件,为我的项目命名为phpauction。


我用utf8编码导入我的数据库,我可以看到字段里面的希腊字母。

问题是,当我去网站寻找结果,我得到问号而不是希腊字符。

我搜索了很多,我发现有一个解决方案是在mysql_select_db之后添加mysql_query(" SET NAMES utf8")。 />

这是正确的吗?

另外,我找不到任何文件中的mysql_select_db。



PS当我导入到mysql时,我从记事本文件中将其保存到***** .sql

我使用默认编码和utf8编码但没有。


我导出我导入的查询并执行以下操作:

我上传到服务器并使用默认编码希腊语,它显示正确。我将浏览器编码更改为UTF8并且我得到了问号。

然后再次使用记事本我用utf-8编码保存它,现在它正确显示UTF8编码默认选择浏览器。

所以,我猜我的一些页面不是为utf8编码设计的。

如果是这样,那给了我两个选项。

A.要获取我所有页面的html代码,请使用记事本打开它并使用utf8编码

B.将utf8的元字符集放入我的所有页面。 (请记住,我为搜索部分使用的页面执行了此操作,并且我还使用utf8中的记事本保存它的组合)

另外,我导入了一些项目您告诉我的导入/导出测试。

我有mysql和collat​​ion到utf8一般ci


1.使用记事本的默认编码,我导入sql文件,我有问号。我没有导出它。

2.我现在用utf8编码保存了sql。我上传了它,mysql显示正确。我通过网站搜索了它,它再次给了我问号。浏览器的编码设置为UTF8。然后我从mysql导出它,保存到html,上传,打开它和希腊编码(默认是正确的)utf8给我问号

解决方案

嗨。


您是否在打印之前过滤了PHP代码中的数据?

比如说,通过使用 htmlentities 功能?


可能是您的数据正确存储在MySQL中,但正在接受处理PHP被错误地回复之前。


谢谢你的回复。


我试图找到完成这项工作的文件(正如我所说的不是由我开发的)

并且发现了这个:


[PHP] / *这个subastas标题和细节链接* /

tplv [ '' ID ''] =

Hi all,

I have a problem with my php and mysql project.
I use an auctions software, named phpauction for my project.

I import into my database with utf8 encodingm and I can see the greek letters inside the fields.
The problem is that when i go to the site for the results, I get question marks instead of the greek characters.
I have searched a lot, and i found that there is a solution by adding mysql_query("SET NAMES utf8") after mysql_select_db.

Is that correct?
Also, i can not find the mysql_select_db in any of the files.


P.S. When I import to mysql i do it from a notepad file that i save it to *****.sql
I used the default encoding and utf8 encoding but nothing.

i export the query i imported and did these:
I uploaded in the sever and with default encoding Greek, it was displayed correctly. I changed browser encoding to UTF8 and i got question marks.
Then using Notepad again i saved it with utf-8 encoding and now it is displayed correctly with UTF8 encoding select by default to the browser.
So, I guess some of my pages are not designed for utf8 encoding.
If it is so, that gives me two options.
A. To get the html code of all my pages, open it with notepad and encode it with utf8
B. To put the meta charset for utf8 to all of my pages. ( Have in mind that i did that for the pages that are used for the searching section, and also I did it with the combination of saving it with notepad in utf8 )
Also, I import some items for the importing/exporting test you told me.
I have mysql and collations to utf8 general ci

1. Using the default encoding of notepad,I import the sql file and i got question marks. i did not exported it.
2. I saved the sql with utf8 encoding now. I uploaded it and mysql displays it right. I searched it through the site and it gave me question marks again. The encoding of browser is set to UTF8. Then i exported it from mysql, saved it into html, uploaded it, opened it and with greek encoding (default is right) utf8 gives me question marks

解决方案

Hi.

Are you filtering the data in your PHP code before printing it?
Like say, by using the htmlentities function?

It could be that your data is being stored correctly in MySQL, but being treated incorrectly by PHP before it is echoed.


Hi, thank you for your reply.

I tried to find the file that does this work (as i said is not developed by me)
and found this :

[PHP]/* this subastas title and link to details */


tplv[''id'']=


这篇关于希腊字符问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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