I have a column in SQL Server with utf8 SQL_Latin1_General_CP1_CI_AS encoding. How can I convert and save the text in ISO 8859-1 encoding? I would like to do thing in a query on SQL Server. Any tips?
Olá. Gostei do jogo. Quando "baixei" até achei que não iria curtir muito
Jason Penny has also written an SQL function to convert UTF-8 to Unicode (MIT licence) which worked on a simple example for me:
The ticked answer by Anthony "looks" better to me, but maybe run both if doing conversion and investigate any discrepencies?!
Also we used the very ugly code below to detect BMP page unicode characters that were encoded as UTF-8 and then converted from varchar to nvarchar fields, that can be converted to UCS-16.
The above:
I have written a function to repair UTF-8 text that is stored in a
varchar
field.To check the fixed values you can use it like this:
Output:
The code:
I found the query I need to do, just not the encoding yet.