It's been a while since we migrated from MySql to SQL Server 2017.
We have a table that contains email html content, the problem we are facing is the characters like '
are stored into SQL DB like this ‘
, I tried to change the collation to rectify this but it did not worked.
Current collation is SQL_Latin1_General_CP1_CI_AS
.
I have tried many things like update the table column collation/charset to utf8, but nothing seems to work. I don't know how many special characters in my column table which contains lots of email templates.
Strange Characters in database text: Ã, Ã, ¢, â‚ €,
https://learn.microsoft.com/en-us/answers/questions/84241/strange-query-result-from-sql-server
Convert text value in SQL Server from UTF8 to ISO 8859-1
So far I have found these special characters ‘, ’, —, “ ,â€, Â
. As per my understanding there can be few solutions:
Find each special characters manually and update each special character with SQL statement.
There can be a regex to pull all the special characters and replace them with correct ones, but that to pulls all other html characters.
If possible update the collation/charset of table column, that may possibly fix these characters but updating the collation/charset does not fix the issue in my case.
UPDATE 1: The data type to column is nvarchar(-1)
I am open to any solutions that can solve my problem, any help would be appreciated.