Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Importing UTF-8 Text Files via DTS

2 views
Skip to first unread message

Jonathan Levine

unread,
Sep 16, 2004, 11:45:05 PM9/16/04
to
I'm thinking the answer is no, but I thought I'd check here first.

Does anyone know if it's possible to import UTF-8 encoded flat text files
via DTS?

Thanks,

Jonathan

Mingqing Cheng [MSFT]

unread,
Sep 17, 2004, 5:19:24 AM9/17/04
to
Hi Jonathan,

Thanks for your postsing!

From your descriptions, I understood that you would like to UTF-8 text
files via DTS. Correct me if I was wrong. Based on my knowledge, files
could be encoded using UTF-16 or UCS-2, not UTF-8.

The Win32 API, Java, ODBC/OLEDB, etc all use UCS-2/UTF-16 as their
representation of Unicode (UCS-2 encodes Unicode using 16 bits per
character instead of the variable 8-24 bits used by UTF-8). If you want to
do much of anything with that data, including inserting it into SQL Server
or some other RDBMS via DTS. you'll have to convert the flat file from
UTF-8 to UTF-16/UCS-2. There is a Win32 function called
MultiByteToWideChar that can do this pretty trivially. If you don't want
to write your own code to do it, there's some sample code to convert from
UTF-8 to UTF-16 on the Unicode Consortium's web site at
http://www.unicode.org/Public/PROGRAMS/CVTUTF.

Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!

Sincerely yours,

Mingqing Cheng

Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---------------------------------------------------------------
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!

Mingqing Cheng [MSFT]

unread,
Sep 21, 2004, 4:06:10 AM9/21/04
to
Hi Jonathan,

I am just checking on your progress regarding the information that was sent
you! Have you tried the steps I provided to you? If you encounter any
difficulty, please do not hesitate to let me know. Please post here and let
me know the status of your issue. Without your further information, it's
very hard for me to continue with the troubleshooting.

Looking forward to hearing from you soon

Jonathan Levine

unread,
Sep 23, 2004, 8:25:02 PM9/23/04
to
""Mingqing Cheng [MSFT]"" wrote:
> Hi Jonathan,
>
> I am just checking on your progress regarding the information that was sent
> you! Have you tried the steps I provided to you? If you encounter any
> difficulty, please do not hesitate to let me know. Please post here and let
> me know the status of your issue. Without your further information, it's
> very hard for me to continue with the troubleshooting.

Thank you very much for your reply. You definitely answered my question!

Regards,

Jonathan

Peter A. Schott

unread,
Sep 24, 2004, 12:01:28 PM9/24/04
to
What was the information? I think I missed that.

-Pete

Jonathan Levine

unread,
Sep 27, 2004, 9:17:01 PM9/27/04
to
Pete,

"Peter A. Schott" wrote:
> What was the information? I think I missed that.

The answer was no, there's no way to load UTF-8 via DTS directly.

I am using iconv (from cygwin) to convert from UTF-8 to UTF-16, then
loading that. But it should be easy to write something that's native windows
that opens a stream as UTF-8 and writes it as UTF-16 ("Unicode").

-- J

-- J

0 new messages