如何MS Access数据库编码转换为UTF-8? [英] How to convert MS Access database encoding to UTF-8?

查看:1101
本文介绍了如何MS Access数据库编码转换为UTF-8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的一个传统的经典ASP + MS-Access应用程序。近日笔者从ISO-8859(Windows)中的编码转换成所有的.asp文件为UTF-8。

我现在的问题是,存储在数据库(法文重音字符)中的文本显示不正确的网页内的渲染时,因为编码不一致。如何将我的MS Access数据库编码从ISO-8859为UTF-8?


解决方案

  

如何将我的MS Access数据库编码从ISO-8859为UTF-8?


你不知道。使用能够处理的Uni code文本,但它并没有将其存储为UTF-8。有一些方法可以直接插入UTF-8 EN codeD文本访问文本字段,但正如我在其他答案的这里

有关ASP应用程序,只需使用.asp的EN codeD页为UTF-8,告诉IIS产生UTF-8输出(通过<%@ codePAGE = 65001 %GT; 指令),并让IIS和访问OLEDB驱动程序处理接入统一code和UTF-8之间的转换

有关访问,经典的ASP,和UTF-8的详细例子在这里看到我的回答是:

捕获并插入统一code文本(西里尔字母)到MS Access数据库

重要提示

请注意,你不应该使用Access数据库为Web应用程序后端数据存储;微软的强烈反对的这样做(参考:这里)。

I am currently working on a legacy Classic ASP + MS-Access application. I recently converted all the .asp files to UTF-8 from ISO-8859 (Windows) encoding.

The problem I have now is that the text stored inside the database (French with accented characters) display improperly when rendered inside the web pages because the encodings are inconsistent. How do I convert my MS Access database encoding from ISO-8859 to UTF-8?

解决方案

How do I convert my MS Access database encoding from ISO-8859 to UTF-8?

You don't. Access can handle Unicode text but it DOES NOT store it as UTF-8. There are ways to directly insert UTF-8 encoded text into Access Text fields but that leads to strange behaviour as illustrated in my other answer here.

For an ASP application, simply use .asp pages encoded as UTF-8, tell IIS to produce UTF-8 output (via the <%@ CODEPAGE = 65001 %> directive), and let IIS and the Access OLEDB driver handle the conversion between "Access Unicode" and UTF-8.

For a detailed example of Access, Classic ASP, and UTF-8 see my answer here:

Capture and insert Unicode text (Cyrillic) into MS access database

Important Note

Be aware that you should NOT be using an Access database as a back-end data store for a web application; Microsoft strongly recommends against doing so (ref: here).

这篇关于如何MS Access数据库编码转换为UTF-8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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