Solved

Convert Data in a txt file to utf-8 format

Posted on 2004-08-03
4
1,092 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now