Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert MS Access database encoding to 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.

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?

like image 465
Carl Mercier Avatar asked Mar 07 '11 17:03

Carl Mercier


1 Answers

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).

like image 74
Gord Thompson Avatar answered Oct 21 '22 02:10

Gord Thompson