Converting Microsoft Access database tables in local encoding into UTF-8 encoding

Converting your site’s encoding from legacy/local encoding into “UTF-8” may result in the data retrieved from your database to appear incorrectly. It may appear as question marks and it may appear as unrecognized characters.

In order to correct the problem you will need to convert your database data encoding from the current one into “UTF-8” encoding.

Here are the basic steps to follow:

1. In Microsoft Access open your database and right click on the table you wish to convert. Choose “Export…” -> in the “Save as type” drop-down list choose “Text Files (*.txt;*.csv;*.tab;*.asc)” -> press the “Export” button. An “Export Text Wizard” will open -> press “Advanced…” -> in the “Language” list choose “All”, in the “Code Page” list choose “User Defined” (it may be written in your local language). Save your settings using the “Save as” button. Press “OK” to return -> “Finish” to export the table data to a text file.

2. Open the exported text file with Windows notepad and check that the data appears correctly (in your language) then go to “File” -> “Save as” and in the “Encoding” list choose “UTF-8” encoding instead of the default “ANSI”.

3. Open your database in Microsoft Access again and go to “File” -> “Get External Data” -> “import”. In the “Files of type” drop-down list choose “Text Files (*.txt;*.csv;*.tab;*.asc)” and locate the exported file from step 1. Press the “Import” button. An “Import Text Wizard” will open -> press “Advanced…” -> Load your save settings by pressing the “Specs” button. In the “Language” list choose “All”, in the “Code Page” list choose “Unicode (UTF-8)”. Press “OK” to return -> “Finish” to import the table data as a table in your database. Because a table with the file’s name already exists Access will ask if you want to insert the data to a new table or to the existing one. Choose to create a new table and give it a temporary name. If there are errors reported in the import process fix them manually by inserting the correct data to the specific fields (usually it’s only the first field of the first record).

4. Make sure the data in the newly created table appears and sorted correctly.

5. Copy the entire data from your new table and paste it over the data in your original table.

If your site still refuses to display your content correctly make sure you followed the steps in our UTF-8 sites and AdSense article.

2 comments

  1. this works like a charm ! but the problem is that ia have an auto numbers generated in the tables, so when i do this method, and import the tables, i am having problems with the IDs. What do you suggest?

    1. This is a very old post, which honestly I can’t remember much of.. Is there a way of copying over the ID numbers (from the original DB) as the last step? Or maybe write a short script that syncs IDs when the conversion is over?

Leave a Reply

Your email address will not be published. Required fields are marked *