3

I have a MS Access table which is encoded in UTF-8 charset and the characters appear like this:

Participació en comissió

If I UTF-8 decode this text I get the correct text:

Participació en comissió

How can I utf-8 decode several Access table columns? I would like to end up with the same MS Access database but with the columns converted (utf-8 decoded). I cannot figure out an easy way to do this conversion.

Thanks in advance.

--

More clarifications:

So how did you decode the text that you have in the question? I simply put the sentence in an online utf-8 decoder but it crashes when there is a lot of text. FYI, the Access table comes from a MS SQL Server database with Modern_Spanish_CI_AS collation and varchar (MAX) data type field. Maybe is there a way to perform the conversion while exporting the table from the MS SQL Server?

Mitteg
  • 169
  • 1
  • 5
  • 15
  • So how did you decode the text that you have in the question? – C Perkins Oct 04 '17 at 01:36
  • This might provide a starting point, but you'll need to make the code work in the context of Access (which I think can be easily done): https://stackoverflow.com/questions/28834528/convert-utf-8-string-to-iso-8859-1 – C Perkins Oct 04 '17 at 04:06
  • How about using the nvarchar datatype? It's for a different encoding (UTF-16) but it is the datatype for the Unicode character set. That way string functions and collations would work, too, as would client APIs. – Tom Blodget Oct 04 '17 at 04:45
  • @TomBlodget Microsoft Access doesn't have an `nvarchar` data type. Just `short text` and `long text` for storing strings. And they are encoded using system encoding (see https://stackoverflow.com/questions/81154/how-do-i-determine-which-encoding-system-is-used-in-my-ms-access-database) – Erik A Oct 04 '17 at 05:47
  • More clarifications added to the post. Thanks. – Mitteg Oct 04 '17 at 06:54
  • While searching for a solution I found this post that has a function decode utf-8 fields right from the MS SQL Server. I tested it and it works perfectly, althought quite slow. Hope this helps someone else with the same problem. Here it is: [link](https://stackoverflow.com/questions/28168055/convert-text-value-in-sql-server-from-utf8-to-iso-8859-1) – Mitteg Oct 04 '17 at 07:47
  • @Mitteg: Please post this (and a short description how you used it) as answer. Thanks! – Andre Oct 04 '17 at 09:04
  • @ErikvonAsmuth Thanks for correcting my faulty research. – Tom Blodget Oct 04 '17 at 13:29
  • Possible duplicate of [Convert text value in SQL Server from UTF8 to ISO 8859-1](https://stackoverflow.com/questions/28168055/convert-text-value-in-sql-server-from-utf8-to-iso-8859-1) Even though the question originally referred only to MS Access, it is later revealed that the table actually resides on SQL Server and the question was already answered in full. The MS Access label and extra wording don't really add anything to the question. – C Perkins Oct 04 '17 at 16:38

1 Answers1

0

While searching for a solution I found this post that has a function to decode utf-8 fields right from the MS SQL Server. I tested it and it works perfectly, althought it is quite slow. Hope this helps someone else with the same problem.

Mitteg
  • 169
  • 1
  • 5
  • 15