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

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

问题描述

我目前正在开发一个传统的 Classic ASP + MS-Access 应用程序.我最近将所有 .asp 文件从 ISO-8859 (Windows) 编码转换为 UTF-8.

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.

我现在遇到的问题是存储在数据库中的文本(带有重音字符的法语)在网页中呈现时显示不正确,因为编码不一致.如何将我的 MS Access 数据库编码从 ISO-8859 转换为 UTF-8?

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?

推荐答案

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

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

你不知道. Access 可以处理 Unicode 文本,但它不会将其存储为 UTF-8.有一些方法可以将 UTF-8 编码的文本直接插入 Access Text 字段,但这会导致奇怪的行为,如我的其他答案 这里.

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.

对于 ASP 应用程序,只需使用编码为 UTF-8 的 .asp 页面,告诉 IIS 生成 UTF-8 输出(通过 <%@ CODEPAGE = 65001 %> 指令),并让IIS和Access OLEDB驱动处理Access Unicode"和UTF-8之间的转换.

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.

有关 Access、Classic ASP 和 UTF-8 的详细示例,请在此处查看我的答案:

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

捕获 Unicode 文本(西里尔文)并将其插入 MS 访问数据库

重要提示

请注意,您不应将 Access 数据库用作 Web 应用程序的后端数据存储;Microsoft强烈建议不要这样做(参考:这里).

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天全站免登陆