By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,836 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,836 IT Pros & Developers. It's quick & easy.

Convert XML Encoding

P: n/a
I have a situation where I am receiving an XML document from a Korean client. They have encoding="EUC-KR" in the XML declaration. This XML file will be placed into a SQL 2005 table with an XML datatype column. I have found that the XML in SQL stores all data as UTF-16. Does anyone know an easy way to programmatically convert my incoming XML into UTF-16? I have to maintain the foreign characters within the document. I have found that I can open the file in XML-SPY and change the encoding and save it and it works but we will be getting hundreds of these documents and that is not feasible.

Thanks,

Matt
May 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Matt wrote:
I have a situation where I am receiving an XML document from a Korean
client. They have encoding="EUC-KR" in the XML declaration. This XML
file will be placed into a SQL 2005 table with an XML datatype column.
I have found that the XML in SQL stores all data as UTF-16. Does anyone
know an easy way to programmatically convert my incoming XML into
UTF-16? I have to maintain the foreign characters within the document.
I have found that I can open the file in XML-SPY and change the encoding
and save it and it works but we will be getting hundreds of these
documents and that is not feasible.


Unix systems have the iconv command which converts files from one
encoding to another. Maybe this exists somewhere for Windows. If not,
a recursive identity transform in XSLT with the output encoding set to
UTF-16 will do this, assuming your XSLT processor supports EUC-KR for
input.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
May 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.