Is there a function in SQL Server to normalize a unicode string? e.g.
UPDATE Orders SET Notes = NormalizeString(Notes, 'FormC')
Unicode Normalization Forms:
A
+ ¨
becomes Ä
Ä
becomes A
+ ¨
A
+ ¨
+ fi
+ n
becomes Ä
+ f
+ i
+ n
Ä
+ fi
+ n
becomes A
+ ¨
+ f
+ i
+ n
i cannot find any built-in function, so i assume there is none.
Ideally, if there can be only one, then i happen to need Form C today:
Unicode normalization form C, canonical composition. Transforms each decomposed grouping, consisting of a base character plus combining characters, to the canonical precomposed equivalent. For example, A + ¨ becomes Ä.
Sorry, no, there is no such function in any version of SQL Server to date (2012 test builds). Comparisons can be correctly composition-insensitive, but there isn't a function to convert character composition usage to one normal form.
It has been suggested for a future version of the ANSI standard under the syntax NORMALIZE(string, NFC)
but it's going to be a long time before this makes it to the real world. For now if you want to do normalisation you'll have to do it in a proper programming language with better string-handling capabilities, either by pulling the string out of the database or by writing a CLR stored procedure to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With