I can't get a simple update or insert to save special äöü characters. Instead they are being stored as äöü.

The website displays äöü characters correctly if they are already stored as äöü in the database using phpMyAdmin (or some other tool like HeidiSQL), but for some reason I can't use my code/connection to the database to store them properly. This is where I stand:

I added charset=utf8 to my connection string:

MM_Connection_STRING = "PROVIDER=MSDASQL;DRIVER={MySQL ODBC 5.1 Driver};port=3306;SERVER=localhost;UID=xxx;PWD=xxx;database=xxx;Option=3;charset=utf8"

I added accept-charset="UTF-8" to all my forms.

I am running MariaDB and IIS 10.

Server version:         10.1.13-MariaDB mariadb.org binary distribution
Protocol version:       10

The page gets proxied using Apache 2.4. I am running asp (classic) code.

Calling the MySQL server for character and collation, I get this:

MariaDB> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR
  Variable_name LIKE 'collation%';

| Variable_name            | Value              |
| character_set_client     | utf8mb4            |
| character_set_connection | utf8mb4            |
| character_set_database   | utf8mb4            |
| character_set_filesystem | binary             |
| character_set_results    | utf8mb4            |
| character_set_server     | utf8mb4            |
| character_set_system     | utf8               |
| collation_connection     | utf8mb4_general_ci |
| collation_database       | utf8mb4_general_ci |
| collation_server         | utf8mb4_general_ci |

The code worked when I was using iso-8859-1 as charset.

Any help will be very much appropriated. Thank you.

  • Update: I just discovered that doing a response.write(request.querystring("val") from a URL containing the values &val=äöü that the äöü characters are being transcoded to äöü. It's no wonder that things are not lining up. IIS 10 should have a setting for that, or I may have to code something to fix it.
    – MeSo2
    Aug 31, 2016 at 22:55
  • Use the SELECT..HEX.. suggestion in stackoverflow.com/a/38363567/1766831 to see whether it was stored correctly or not. For correctly stored utf8, expect hex C3A4 C3B6 C3BC for äöü.
    – Rick James
    Sep 1, 2016 at 0:32
  • Thank you Rick James for the link. Yes, the SELECT g, HEX(g) FROM table test turned out positive. The CODEPAGE="65001" declaration change did the trick for asp classic to encode in utf8. (No need to declare charset in connection string.)
    – MeSo2
    Sep 2, 2016 at 15:28
  • Have you tested the HEX after dropping the charset from the connection string? I think they are both important, and handle radically different things.
    – Rick James
    Sep 2, 2016 at 17:28

1 Answer 1


I had <%@language="VBSCRIPT" CODEPAGE="1252" LCID=1033%> and needed <%@language="VBSCRIPT" CODEPAGE="65001" LCID=1033%> for it to work. Also, after doing this I needed to drop charset=utf8 from the connection string.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.