How to convert encoding of MS Access database to UTF-8?

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

Now the problem is that the text stored inside the database (French with accented characters) does not display correctly when rendering inside web pages, because the encodings are inconsistent. How to convert MS Access database encoding from ISO-8859 to UTF-8?

+7
source share
3 answers

How can I convert the encoding of an MS Access database from ISO-8859 to UTF-8?

You do not have. Access can handle Unicode text, but it does NOT store it as UTF-8. There are ways to directly embed UTF-8 encoded text in Access Text fields, but this leads to weird behavior, as shown in my other answer here .

For an ASP application, simply use .asp pages encoded as UTF-8, tell IIS about the release of UTF-8 (via the <%@ CODEPAGE = 65001 %> directive), and let the 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:

Capturing and inserting Unicode (Cyrillic) text into the MS access database

Important Note

Remember that you should not use the Access database as a data warehouse for a web application; Microsoft strongly recommends that you do not do this (link: here ).

+5
source

You might be able to write an Access UPDATE statement that uses the StrConv function to convert text to Unicode.

See http://www.techonthenet.com/access/functions/string/strconv.php

+1
source

I ended up using Server.HTMLEncode to output text from my database. It completely broke all the HTML that I stored there, so I have to write an ugly hack to avoid converting the html tags to html-safe strings. Now it works, but this, of course, is not the most elegant solution ...

+1
source

All Articles