Does anyone know if it's possible to import UTF-8 encoded flat text files
via DTS?
Thanks,
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!
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
Thank you very much for your reply. You definitely answered my question!
Regards,
Jonathan
-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