Character Set different for each column

Character Set different for each column

Postby KW » Wed 01 Jun 2016 20:33

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

For example,

Table1
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;
KW
 
Posts: 121
Joined: Tue 19 Feb 2008 19:12

Re: Character Set different for each column

Postby 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).
Shalex
Devart Team
 
Posts: 7612
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL