开发者

searching sql DB table for japanese terms

开发者 https://www.devze.com 2023-03-14 16:45 出处:网络
I have a table with columns that allow for different language formats (using nvar开发者_开发技巧char) and the problem is that when I try to search for these terms; particularly Japanese/Chinese terms,

I have a table with columns that allow for different language formats (using nvar开发者_开发技巧char) and the problem is that when I try to search for these terms; particularly Japanese/Chinese terms, the typical select statement does not work

select * from jtable where searchterm = 'ろくでなし'

It will return 0 which is incorrect since it is definitely in the table. Someone mentioned using cast(....) but not sure how to do this.


Need an N to make the string literal unicode.

select * from jtable where searchterm = N'ろくでなし'

Without the N the 'ろくでなし' is implicit varchar and is seen as '?????'

See my related answer about khmer text for examples of why: Khmer Unicode, English and Microsoft SQL Server 2008 results in questionmarks

0

精彩评论

暂无评论...
验证码 换一张
取 消