distal-attribute
distal-attribute
distal-attribute
distal-attribute

Viewing characters in UTF

niente0 posted 2 years ago in Feature discussion
Hello all, I created a database with UTF-8 charset. After some trouble, I can write and read any special characters from the UTF-8 DB (I'm using ASP pages). However, if I look directly into the database with Heidi, I cannot see any special character I wrote but only some garbage.
For example, if I write a 'é' into a text field, it's translated into 'é' (I think it's the 'é' character shown in ISO-8892-1 encoding). When I read it from ASP, it reads correctly again as 'é'.
Would it be possible to display the content of databases with the UTF-8 encoding in a correct way also in Heidi?
Ie. 'sélectionner' instead of 'sélectionner'? happy
Thank you
ansgar posted 2 years ago
Your database content is broken if you see such characters in HeidiSQL. Check another client, like phpMyAdmin or MySQL Query Browser or Navicat or whatever - all of them will display the same broken characters.

But you can fix that. You will need to transform text columns to utf8 charset. I guess your database, table and columns are set up to use the mentioned ISO encoding?
niente0 posted 2 years ago
Thanks for your answer. Yes, the DB was built as ISO-8892-1 latin encoding, and then converted into UTF-8. I'll fix all the texts with a series of 'replace'.
Anyway, I solved my 'garbage chars' problem. At some point, during the xmlhttprequest, single-byte special UTF chars were interpreted as 2-byte latin chars and written into database.
The solution I found was to add or move to the top of my ASP files these two instructions:
Response.CodePage = 65001
Response.CharSet = "utf-8"

Now it works perfectly and I can read any character even inside Heidi!
Thank you again for your answer happy

Please login to leave a reply, or register at first.