From: Pepe Jeans on
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
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
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
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
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