We are a software developer here and ran into a problem trying to get SQL Server to display Japanese Characters through a linked server properly. Does anybody have any similar experiences?
The following configurations were able to display Japanese characters properly:
===============================================================================
1. Write a C# application to get Japanese characters from an AS400 table containing Japanese texts. The Japanese text was displayed on the DataGrid. The provider used was HiT OLEDB Server/400. A 30 day eval copy can be obtained from the following link:
http://www.hitsw.com/products_services/register/register_oledb_svr_400.html
2. Create a table containing Japanese text on SQL Server A and create a linked server on SQL Server B linking to SQL Server A. Change the font type of SQL Server B's query analyzer to a font that is compatible with Japanese character. (See code sample one at the bottom of this message for the code used)
3. On a new PC, install Japanese edition of Windows 2000 plus Japanese Edition of SQL Server 2000. Create a linked server pointing to a Japanes table on the AS400 using the HiT OLEDB provider.
The following configurations were not able to display Japanese characters properly:
===================================================================================
i. On a PC with English version of Windows 2000 Professional and English version of SQL Server, change the query analyzer font to a font that is compitable with Japanese text and then use the HiT OLEDB provider to create a linked server pointing to the Japanese table on the AS400.
ii. On the same PC above, install IBM Client Access and make a new linked server pointing to the same Japanese table on the AS400 using Client Access. A Japanese compitable font was selected in the query anaylzer.
The odd thing is that in configuration (1), we were able to see the Japanese characters correctly which suggests that the HiT OLEDB provider has passed the information back to the PC correctly. And in configuration (2) and (3), we were able to show that SQL Server has no problem displaying Japanese characters regardless of its language edition.
We are not sure why it is behaving this way. Does anybody have any thought?
Here is the code used:
Code Sample One
===============
The following code was used on an English version of SQL Server 2000 running on an English version of Windows
2000 professional
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblJap]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[tblJap]
GO
CREATE TABLE [dbo].[tblJap] (
[CID] [int] IDENTITY (1, 1) NOT NULL ,
[Jap] [nchar] (30) NOT NULL ,
[Eng] [char] (30) NOT NULL
) ON [PRIMARY]
GO
INSERT INTO tblJap (Jap, Eng) VALUES ('織田信長','Oda Nobunaga')
INSERT INTO tblJap (Jap, Eng) VALUES ('豊臣秀吉','Toyotomi Hideyoshi')
INSERT INTO tblJap (Jap, Eng) VALUES ('徳川家康','Tokugawa Ieyasu')
--See note below
GO
SELECT * FROM tblJap
Note
====
Another odd thing was that if I run the code
INSERT INTO tblJap (Jap, Eng) VALUES ('織田信長','Oda Nobunaga')
from query analyzer, the Japanese characters showed up as ? in Enterprise Manager. But if I edit the information again from Enterprise Manager, it shows up properly in both Enterprise Manager and Query Analyzer.
Results you are seeing might be due to the fact that you are inserting characters as regular chars and not as Unicode chars, and their translation (effectively truncation) is affected by Query Analyzer.
Instead of
INSERT INTO tblJap (Jap, Eng) VALUES ('...(Japanese chars)...','Oda Nobunaga')
try
INSERT INTO tblJap (Jap, Eng) VALUES (N'...(Japanese chars)...','Oda Nobunaga')
and see if that fixes your problem.
Regards,
Boris.|||Your solution is working fine.
No comments:
Post a Comment