question

arehmank avatar image
arehmank asked

problem with unicode search, return invalid results

i have following text coming in data

Unicode Text Unicode Entities
三田 屋 はむ %u4E09 %u7530 %20 %u5C4B %20 %u306F %u3080
三田 屋 ハム %u4E09 %u7530 %20 %u5C4B %20 %u30CF %u30E0

both strings are clearly different however when i execute following queries than both return same result (i.e. 三田 屋 ハム)

select   * 
from   (
       select N'三田 屋 ハム' as a union
       select N'三田 屋 はむ' 
     ) a 
where   a = N'三田 屋 ハム'

select   * 
from   (
       select N'三田 屋 ハム' as a union
       select N'三田 屋 はむ' 
     ) a 
where   a = N'三田 屋 はむ'

i get valid result for following query

select    * 
from    (
            --select N'三田 屋 ハム' as a union
            select N'三田 屋 はむ' a
        ) a 
where    a = N'三田 屋 はむ'

i have checked the Unicode value and both are differnt

select UNICODE(N'三'), UNICODE(N'田'), UNICODE(N'屋'), UNICODE(N'ハ'), UNICODE(N'ム') union 
select UNICODE(N'三'), UNICODE(N'田'), UNICODE(N'屋'), UNICODE(N'は'), UNICODE(N'む')

can someone please let me know if i am missing something here. thanks.

sqlunicode
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image ThomasRushton ♦♦ commented ·

What collation are you using?

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.