Using unicode characters above 65500 return the incorrect results when using some string functions such as replace.The following command:SELECT REPLACE(N'test' + NCHAR(65500), NCHAR(65500), '')successfully strips out the added unicode character, however if you use any unicode characters above 65500 (including valid Unicode 1.0 characters), the replace function does not work correctly.For example if you run:SELECT REPLACE(N'test' + NCHAR(0xFFFD), NCHAR(0xFFFD), '')The unicode character 65533 does not get stripped out, unlike all other valid unicode characters.The workaround is to cast the string as a binary:SELECT REPLACE(N'test' + NCHAR(0xFFFD) COLLATE Latin1_General_BIN, NCHAR(0xFFFD) COLLATE Latin1_General_BIN, '')however, this should not be necessary if the function had worked correctly.
Version
Category
Operating System
Platform
Please wait...