473,395 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Convert XML Encoding

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
1 1954
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: hunterb | last post by:
I have a file which has no BOM and contains mostly single byte chars. There are numerous double byte chars (Japanese) which appear throughout. I need to take the resulting Unicode and store it in a...
2
by: Du Dang | last post by:
I tried to convert a block of text from iso-8859-1 to utf-8 but all I got after the convertion is gibberish. =============================== FileStream fs = File.Open("text.txt",...
4
by: Albert Jan | last post by:
Hi, I have text from mime email messages with different encoding that I want to convert to utf-8, but I'm relatively new on encoding problems. I use the following code, but this doesn't seem...
3
by: Jan Eliasen | last post by:
Hi I have a string, which I must convert into another string and have it utf-8 encoded. My current code looks like this; Both vDataIn and vDataOut are Objects (parameters to a...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
12
by: Brian Henry | last post by:
first question... I have a flat file which unfortinuatly has columns seperated by nulls instead of spaces (a higher up company created it this way for us) is there anyway to do a readline with this...
8
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does...
4
by: Franky | last post by:
I have a Command Prompt window open and select all the characters and copy them to the clipboard. I then read them from the clipboard str = CType(DataO.GetData(DataFormats.OemText, False),...
0
by: deloford | last post by:
Hi This is going to be a question for anyone who is an expert in C# Text Encoding. My situation is this: I have a Sybase database which is firing back ISO-8559 encoded strings. I am unable to...
6
by: Bob Altman | last post by:
Hi all, I'm looking for the fastest way to convert an array of bytes to String. I also need to convert a String back to its original Byte() representation. Convert.ToBase64String and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.