Solved

Convert Data in a txt file to utf-8 format

Posted on 2004-08-03
4
1,097 Views
Last Modified: 2007-12-19
I am trying to import data from a text file to a SQL2000 table as utf-8 formate. The data in the text file is in Chinese and not in utf-8 format. This will need to be done with a Scheduled DTS.
0
Comment
Question by:awu25
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:jdlambert1
ID: 11711817
Shouldn't be a problem if you make the destination table first, using the nchar or nvarchar datatypes. This stores unicode (UCS-2). Then just use DTS normally. No collation specifications are necessary for storing Chinese characters in a unicode column, but you might want to consider specifying a Chinese collation for the column when you create the table (simplified or traditional) if you're going to order output based on it.
0
 

Author Comment

by:awu25
ID: 11711896
I have done all that. If I use the Enterprise Manager installed on a Chinese XP and import the file manually without going thru DTS then it works fine. It is when I import from an English OS does it import garbage.
0
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 500 total points
ID: 11711930
Hmm. Try changing your local code page -- even if your OS is in English, you can use a non-English Collation.

"In Control Panel, find the Windows locale name in the Regional Settings application (Microsoft® Windows NT® 4.0, Microsoft Windows® 98, and Microsoft Windows 95) or the Regional Options application (Microsoft Windows 2000), and then use this table to find the corresponding Collation Designator and code page:

Windows locale, LCID (locale ID), Collation designator, Code page
Chinese (Taiwan) 0x30404 Chinese_Taiwan_Bopomofo 950
Chinese (Taiwan) 0x404 Chinese_Taiwan_Stroke 950
Chinese (People's Republic of China) 0x804 Chinese_PRC 936
Chinese (People's Republic of China) 0x20804 Chinese_PRC_Stroke 936
Chinese (Singapore) 0x1004 Chinese_PRC 936
0
 

Author Comment

by:awu25
ID: 11712189
Problem solved by chaning the windows locale. Thank you
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question