Character Set different for each column

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Posts: 124
Joined: Tue 19 Feb 2008 19:12

Character Set different for each column

Post by KW » Wed 01 Jun 2016 20:33

What is the correct way to handle different character sets per column?

For example,

col1 = latin1
col2 = utf8
col3 = utf8mb4

Is there any way to do a select * from this table and have the information properly decoded back to you in one go? Or do you have to set the connection string to the character set every time so:

ConnctionString = "xxx characterset=latin1";
Select col1 from Table1;

ConnctionString = "xxx characterset=utf8";
Select col2 from Table1;

ConnctionString = "xxx characterset=utf8mb4";
Select col3 from Table1;

Devart Team
Posts: 8083
Joined: Thu 14 Aug 2008 12:44

Re: Character Set different for each column

Post by Shalex » Fri 03 Jun 2016 15:20

Try using "characterset=utf8mb4;" with all three columns because utf8mb4 is the largest character set from the list and it should handle correctly col1 (latin1), col2 (utf8), and col3 (utf8mb4).

Post Reply