ASP,MySQL和UTF-8 [英] ASP, MySQL and UTF-8

查看:160
本文介绍了ASP,MySQL和UTF-8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我读过几乎所有的这个主题。我已经尝试了所有建议,但我不能解决这个问题。

First of all, I've read almost all topics about this. I've tried all advices but I couldn't solve this problem.

下面是事情。我用传统的ASP和MySQL的项目。一切就好了。如果我写的(例子)的Response.Write(ĞŞÜÇÖİ),它的工作原理就像一个魅力。但是,如果该字符串来自数据库,我看ÄÅÜÇA-A°而不是ĞŞÜÇÖİ。当我看到这与phpMyAdmin它的确定。

Here is the thing. I use Classic ASP and MySQL for a project. Everything just fine. If I write (an example) Response.Write("ĞŞÜÇÖİ") it works like a charm. But if that string comes from database, I see "ÄÅÜÇÖİ" instead of "ĞŞÜÇÖİ". When I look this with phpMyAdmin it's ok.

我使用Dreamweaver CS6。我保存所有网页的Uni code(UTF-8)。我已经写了会议。codePAGE = 65001,响应。codePAGE = 65001,Response.Charset的=UTF-8,在每一个页面都有它的顶部包含文件。我已经写了元字符集UTF-8。我用ODBC 5.2 x64的驱动程序,我的连接字符串的字符集:UTF8 ;.和所有MySQL设置UTF-8(表,字段,一切)。

I use Dreamweaver CS6. I save all pages Unicode (UTF-8). I've written Session.CodePage = 65001, Response.CodePage = 65001, Response.Charset = "utf-8" in an include file that every page has it at the top. I've written meta charset utf-8. I use ODBC 5.2 x64 driver and my connection string has charset:UTF8;. And all MySQL settings utf-8 (tables, fields, everything).

好吧,我不希望使用其他的编码,字符集。我在做什么做错了吗?看来,这是有关数据库。有什么问题?

Well I don't want to use other encodings, charsets. What am I doing doing wrong? It seems, it's about database. What is the problem?

推荐答案

您需要指定字符使用的字符集参数连接字符串中设置;看到<一个href=\"https://dev.mysql.com/doc/refman/5.5/en/connector-odbc-configuration-connection-parameters.html\"相对=nofollow> MySQL的ODBC DOCO 。例如添加<罢>的charset = UTF8;的charset = UCS2;到连接字符串。

You need to specify the character set in the connection string using the charset parameter; see the MySQL ODBC doco. e.g. add "charset=utf8;" "charset=ucs2;" to your connection string.

编辑:我终于有机会在这个运行一个简单的测试工具,它确实失败的charset = UTF8。然而,由于VBScript是与内部运行UCS2,我给它与字符集= UCS2一个尝试,它工作正常。注:页面仍设置为所有输出发送为UTF-8,它只是VBScript是使用UCS2 ODBC连接提取数据。做好这项工作是:)

Edited: I finally got a chance to run a simple test harness on this, and it does indeed fail with charset=utf8. However, since VBScript is running internally with UCS2, I gave it a try with charset=ucs2 and it works fine. NB: page is still set to send all output as UTF-8, it's just that VBScript is pulling data from an ODBC connection using UCS2. Job is done :)

这篇关于ASP,MySQL和UTF-8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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