Encoding change

K

Kiran

Hi All,
I have a xml file with UTF-8 encoding it has some chineese data values
also. I wanted to change it to other encodings like UTF-16 ,GBK etc. I
used iconv utility in Unix for this ..but was not successful . Can
anybody provide some help regarding this ?.

Thanks,

Kiran Nair
 
K

Klaus Johannes Rusch

Kiran said:
I have a xml file with UTF-8 encoding it has some chineese data values
also. I wanted to change it to other encodings like UTF-16 ,GBK etc. I
used iconv utility in Unix for this ..but was not successful . Can
anybody provide some help regarding this ?.

Not successful in what way? Did iconv fail, or was the output incorrect?

You can transcode the file with a fairly simple XSLT transformation
using your favorite XSLT processor, essentially specifying a different
output encoding and copying everything from the source document:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:eek:utput encoding="utf-16" />
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
 
K

Kiran

Thanks Klaus .

I will try this . Yes iconv did not give any results ..

How do I check that the output file that I have got is of what encoding
?
 
?

=?ISO-8859-1?Q?J=FCrgen_Kahrs?=

Kiran said:
I will try this . Yes iconv did not give any results ..

I cant believe this. Write a "Hello World!"
text file and try to use iconv on it. If
iconv really produces nothing, you should
post a bug report.

Could it be that you converted to utf-16
and tried to read the result as a C-string ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top