From: Pepe Jeans on 10 Aug 2010 03:13 Hi all I have a table with chinese characters, but when I try to do a select I have this... Select ID, chinese_text From table1 ID chinese_text 216 ?????? / ?? 117 ?????? / ?? 230 ?? (??) / ?? How to tell the server in order to show the correct strings in chinese? (Sql server 2005) Thanks a lot.
From: Erland Sommarskog on 10 Aug 2010 03:37 Pepe Jeans (pepitoj98(a)gmail.com) writes: > I have a table with chinese characters, but when I try to do a select I > have this... > > Select ID, chinese_text > From table1 > > ID chinese_text > 216 ?????? / ?? > 117 ?????? / ?? > 230 ?? (??) / ?? > > How to tell the server in order to show the correct strings in chinese? > (Sql server 2005) You need to have a font that includes Chinese characters. What is the data type of the column? -- Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
From: Pepe Jeans on 10 Aug 2010 03:46 Tahnks for your reply, It's a TEXT Varchar(2000) How can add a chinese font? Cheers. On 8/10/2010 9:37 AM, Erland Sommarskog wrote: > Pepe Jeans (pepitoj98(a)gmail.com) writes: >> I have a table with chinese characters, but when I try to do a select I >> have this... >> >> Select ID, chinese_text >> From table1 >> >> ID chinese_text >> 216 ?????? / ?? >> 117 ?????? / ?? >> 230 ?? (??) / ?? >> >> How to tell the server in order to show the correct strings in chinese? >> (Sql server 2005) > > You need to have a font that includes Chinese characters. > > What is the data type of the column?
From: Tom Cooper on 10 Aug 2010 12:28 Chinese requires 16 bit characters (Unicode). Varchar only stores 8 bit characters. You need to use nvarchar. You may need other changes as well. (like unicode constants need to be N'whatever', not just 'whatever'. Look up the UNICODE topic in BOL for info on how to store and use UNICODE characters. You may well already have a Chinese font. You can tell if you have one by running the following Declare @v nvarchar(10); Set @v = CAST(0x604F7D59164E4C75 As nvarchar(10)) Select @v If you can read the result in Chinese, then you have a Chinese font. Please note that I do not speak or read Chinese. So if Babelfish misled me and the above generates nonsense or worse, something offensive, please accept my apologies. Tom "Pepe Jeans" <pepitoj98(a)gmail.com> wrote in message news:OFhdjAGOLHA.1868(a)TK2MSFTNGP05.phx.gbl... > Tahnks for your reply, > > It's a TEXT Varchar(2000) > How can add a chinese font? > > Cheers. > > > > > On 8/10/2010 9:37 AM, Erland Sommarskog wrote: >> Pepe Jeans (pepitoj98(a)gmail.com) writes: >>> I have a table with chinese characters, but when I try to do a select I >>> have this... >>> >>> Select ID, chinese_text >>> From table1 >>> >>> ID chinese_text >>> 216 ?????? / ?? >>> 117 ?????? / ?? >>> 230 ?? (??) / ?? >>> >>> How to tell the server in order to show the correct strings in chinese? >>> (Sql server 2005) >> >> You need to have a font that includes Chinese characters. >> >> What is the data type of the column?
From: Pepe Jeans on 11 Aug 2010 07:45 On 8/10/2010 6:28 PM, Tom Cooper wrote: > Chinese requires 16 bit characters (Unicode). Varchar only stores 8 bit > characters. You need to use nvarchar. You may need other changes as > well. (like unicode constants need to be N'whatever', not just > 'whatever'. Look up the UNICODE topic in BOL for info on how to store > and use UNICODE characters. > > You may well already have a Chinese font. You can tell if you have one > by running the following > > Declare @v nvarchar(10); > Set @v = CAST(0x604F7D59164E4C75 As nvarchar(10)) > Select @v > > If you can read the result in Chinese, then you have a Chinese font. > Please note that I do not speak or read Chinese. So if Babelfish misled > me and the above generates nonsense or worse, something offensive, > please accept my apologies. > > Tom > > "Pepe Jeans" <pepitoj98(a)gmail.com> wrote in message > news:OFhdjAGOLHA.1868(a)TK2MSFTNGP05.phx.gbl... >> Tahnks for your reply, >> >> It's a TEXT Varchar(2000) >> How can add a chinese font? >> >> Cheers. >> >> >> >> >> On 8/10/2010 9:37 AM, Erland Sommarskog wrote: >>> Pepe Jeans (pepitoj98(a)gmail.com) writes: >>>> I have a table with chinese characters, but when I try to do a select I >>>> have this... >>>> >>>> Select ID, chinese_text >>>> From table1 >>>> >>>> ID chinese_text >>>> 216 ?????? / ?? >>>> 117 ?????? / ?? >>>> 230 ?? (??) / ?? >>>> >>>> How to tell the server in order to show the correct strings in chinese? >>>> (Sql server 2005) >>> >>> You need to have a font that includes Chinese characters. >>> >>> What is the data type of the column? > Thanks for this, very useful. Cheers
|
Pages: 1 Prev: Help with the SP. Next: Getting text message from DBCC commands |