Skip to Content
author's profile photo Former Member
Former Member

convert a UTF-16 format file to UTF-8 format

Hi all

I have a xml file in UTF-16 format I have to convert it into UTF-8 format so that

it can be opened with Internet Explorer.now when i am opening the file its showing error"<b>Whitespace is not allowed at this location. Error processing resource 'file</b>"

the file content is given below

< ? x m l v e r s i o n = " 1 . 0 " e n c o d i n g = "

u t f - 8 " ? >

< _ G L B - R G T X _ O R D E R S C P G >

< I D O C B E G I N = " 1 " >

< E D I _ D C

4 0 S E G M E N T = " 1 " >

< T A B N A M > E

D I _ D C 4 0 < / T A B N A M >

< M A N D T > 1

5 2 < / M A N D T >

< D O C N U M > 0 0 0 0 0 0

0 0 0 2 7 5 9 7 2 2 < / D O C N U M >

< D O C R

E L > 6 2 0 < / D O C R E L >

< S T A T U S > 3

0 < / S T A T U S >

< D I R E C T > 1 < / D I R

E C T >

< O U T M O D > 2 < / O U T M O D >

< E X P R S S / >

< T E S T / >

< I D O C T Y P > O R D E R S 0 5 < / I D O C T Y P >

< C I M T Y P > / G L B / R G T X _ O R D E R S

C P G < / C I M T Y P >

< M E S T Y P > O R D C

H G < / M E S T Y P >

< M E S C O D / >

< M E S F C T / >

< S T D / >

< S T D V R S / >

< S T D M E S > O R D C H G <

/ S T D M E S >

< S N D P O R > S A P G E 7 < /

S N D P O R >

< S N D P R T > L S < / S N D P R

T >

< S N D P F C / >

< S N D P R

N > G E 7 Q A R 3 1 5 2 < / S N D P R N >

< S N

D S A D / >

< S N D L A D / >

< R

C V P O R > A 0 0 0 0 0 0 0 4 0 < / R C V P O R >

< R C V P R T > L S < / R C V P R T >

< R C V

P F C > L S < / R C V P F C >

< R C V P R N > R

L E C P G W D I 1 < / R C V P R N >

< R C V S A

D / >

< R C V L A D / >

< C R E D

A T > 2 0 0 7 0 6 0 5 < / C R E D A T >

< C R E

T I M > 1 5 4 1 5 3 < / C R E T I M >

< R E F I

N T / >

< R E F G R P / >

< R E F

M E S / >

< A R C K E Y / >

< S E

R I A L > B U S 2 0 1 2 1 1 0 0 0 0 0 3 0 1 < / S E R

I A L >

< / E D I _ D C 4 0 >

< E 1 E D K

0 1 S E G M E N T = " 1 " >

< C U R C Y > E U

R < / C U R C Y >

< W K U R S > 1 . 0 0 0 0 0 <

/ W K U R S >

< Z T E R M > Z 0 0 1 < / Z T E R

M >

< B S A R T > N B < / B S A R T >

< B E L N R > 4 5 2 0 0 2 2 0 7 2 1 1 0 0 0 0 0 3 0 0 < /

B E L N R >

< R E C I P N T _ N O > 0 1 0 0 0 0

0 0 0 5 < / R E C I P N T _ N O >

< A B R V W _

B E Z > B U S 2 0 1 2 1 1 0 0 0 0 0 3 0 0 < / A B R V

W _ B E Z >

< _ G L B - R G T _ C H A N G E F L

A G S E G M E N T = " 1 " >

< Q U A L F >

0 0 2 < / Q U A L F >

< F L A G > X < / F L

A G >

< / _ G L B - R G T _ C H A N G E F L A G

>

< _ G L B - R G T _ C P G D A T A S E G M E

N T = " 1 " >

< L A N G U > e n < / L A N G

U >

< C O N S I G N _ F L A G > S < / C O N

S I G N _ F L A G >

< I N D I C A T > S < /

I N D I C A T >

< / _ G L B - R G T _ C P G D A

T A >

< / E 1 E D K 0 1 >

< E 1 E D K 1 4

S E G M E N T = " 1 " >

< Q U A L F > 0 1 4 <

/ Q U A L F >

< O R G I D > Z 2 0 0 < / O R G I

D >

< / E 1 E D K 1 4 >

< E 1 E D K 1 4

S E G M E N T = " 1 " >

< Q U A L F > 0 0 9 < /

Q U A L F >

< O R G I D > 0 0 3 < / O R G I D >

< / E 1 E D K 1 4 >

< E 1 E D K 1 4 S E

G M E N T = " 1 " >

< Q U A L F > 0 1 3 < / Q U

A L F >

< O R G I D > N B < / O R G I D >

< / E 1 E D K 1 4 >

< E 1 E D K 1 4 S E G M E

N T = " 1 " >

< Q U A L F > 0 1 1 < / Q U A L F

>

< O R G I D > Z 2 0 1 < / O R G I D >

< / E 1 E D K 1 4 >

< E 1 E D K 0 3 S E G M E N

T = " 1 " >

< I D D A T > 0 1 2 < / I D D A T >

< D A T U M > 2 0 0 7 0 5 1 8 < / D A T U M >

< / E 1 E D K 0 3 >

< E 1 E D K 0 3 S E G

M E N T = " 1 " >

< I D D A T > 0 1 1 < / I D D

A T >

< D A T U M > 2 0 0 7 0 5 1 8 < / D A T U

M >

< / E 1 E D K 0 3 >

< E 1 E D K A 1

S E G M E N T = " 1 " >

< P A R V W > A G < / P

A R V W >

< P A R T N > 2 0 0 0 0 1 2 < / P A R

T N >

< T E L F 1 > + 4 1 2 1 9 2 4 1 8 6 8 < /

T E L F 1 >

< T E L F X > + 4 1 2 1 9 2 4 1 8 6

7 < / T E L F X >

< B N A M E > P l a n t O p

e r . B u y e r < / B N A M E >

< P A O R G >

Z 2 0 0 < / P A O R G >

< O R G T X > E u r o p

e < / O R G T X >

< P A G R U > 0 0 3 < / P A G

R U >

< / E 1 E D K A 1 >

< E 1 E D K A 1

S E G M E N T = " 1 " >

< P A R V W > L F < /

P A R V W >

< P A R T N > 0 1 0 0 0 0 0 0 0 5 <

/ P A R T N >

< N A M E 1 > I n t e r n a t i o

n a l A g r o . < / N A M E 1 >

< S T R A S >

1 4 R u e d e S a h o n e < / S T R A S >

< S T R S 2 > C h r i s t < / S T R S 2 >

< P F

A C H > 1 5 5 < / P F A C H >

< O R T 0 1 > L y

o n < / O R T 0 1 >

< P S T L Z > 1 0 2 0 4 < /

P S T L Z >

< L A N D 1 > F R < / L A N D 1 >

< T E L F 1 > 0 8 1 < / T E L F 1 >

< S P R A S > E < / S P R A S >

< B N A M E > A

l f r e d o < / B N A M E >

< I L N N R > 7 6 5

4 3 2 1 5 4 3 2 1 5 < / I L N N R >

< S P R A S

_ I S O > E N < / S P R A S _ I S O >

< _ G L B

- R G T _ T A X C O D E S S E G M E N T = " 1 " >

< S P T N U M > 3 4 5 < / S P T N U M >

< C Y T A X N U M > 4 5 6 < / C Y T A X N U M >

< O T R I N F O > F R 9 8 7 1 2 5 6 4 4 4 2 < / O T

R I N F O >

< / _ G L B - R G T _ T A X C O D E

S >

< / E 1 E D K A 1 >

< E 1 E D K A 1

S E G M E N T = " 1 " >

< P A R V W > E K < / P

A R V W >

< N A M E 1 > F R P L N e u t r a

l i a < / N A M E 1 >

< N A M E 2 > G T C o p

y R e f e r e n c e F a c t o r y < / N A M E 2 >

< S T R A S > G l o b e S t r e e t Z 2 0 3 < / S

T R A S >

< O R T 0 1 > N e u t r a l i a < / O

R T 0 1 >

< P S T L Z > 9 9 9 9 9 < / P S T L Z

>

< L A N D 1 > F R < / L A N D 1 >

< B N A M E > A l e s s a n d r o V e r r e s c h i < / B

N A M E >

< I L N N R > 5 0 0 0 2 4 3 0 0 0 4 9

7 < / I L N N R >

< _ G L B - R G T _ T A X C O

D E S S E G M E N T = " 1 " >

< C R N U M

> 2 9 8 < / C R N U M >

< S P T N U M > 3 9

8 < / S P T N U M >

< C Y T A X N U M > 4 9

8 < / C Y T A X N U M >

< / _ G L B - R G T _ T

A X C O D E S >

< _ G L B - R G T _ C P G M I D

S E G M E N T = " 1 " >

< S M T P _ A D D

R > a l e s s a n d r o . v e r r e s c h i @ n e s t l e .

c o m < / S M T P _ A D D R >

< / _ G L B - R G

T _ C P G M I D >

< / E 1 E D K A 1 >

< E

1 E D K A 1 S E G M E N T = " 1 " >

< P A R V

W > L S < / P A R V W >

< P A R T N > 0 1 0 0 0

0 0 0 0 5 < / P A R T N >

< I L N N R > 7 6 5 4

3 2 1 5 4 3 2 1 5 < / I L N N R >

< / E 1 E D K A 1

>

< E 1 E D K A 1 S E G M E N T = " 1 " >

< P A R V W > W E < / P A R V W >

< N A M

E 1 > F R P L N e u t r a l i a < / N A M E 1 >

< N A M E 2 > G T C o p y R e f e r e n c e F a c

t o r y < / N A M E 2 >

< S T R A S > G l o b e

S t r e e t Z 2 0 3 < / S T R A S >

< O R T

0 1 > N e u t r a l i a < / O R T 0 1 >

< P S T

L Z > 9 9 9 9 9 < / P S T L Z >

< L A N D 1 > F

R < / L A N D 1 >

< _ G L B - R G T _ E 1 E D K

A 1 S E G M E N T = " 1 " / >

< / E 1 E D K A 1 >

< E 1 E D K A 1 S E G M E N T = " 1 " >

< P A R V W > R G < / P A R V W >

< N A M E

1 > G L O B E R e f e r e n c e F r a n c e < / N A M E

1 >

< S T R A S > S t r e e t 1 < / S T R A S

>

< O R T 0 1 > C i t y < / O R T 0 1 >

< P S T L Z > 1 2 3 4 5 < / P S T L Z >

<

L A N D 1 > F R < / L A N D 1 >

< I L N N R > 5

0 0 0 2 4 3 0 0 0 7 0 1 < / I L N N R >

< _ G L

B - R G T _ T A X C O D E S S E G M E N T = " 1 " >

< C O T A X N U M > 1 2 3 4 < / C O T A X N U M >

< C R N U M > 1 2 3 4 5 6 7 8 < / C R N U M

>

< S P T N U M > 1 0 0 5 1 9 6 2 < / S P T

N U M >

< C Y T A X N U M > 1 0 0 5 1 9 6 2

< / C Y T A X N U M >

< O T R I N F O > 0 0

0 0 0 0 0 5 6 7 8 9 < / O T R I N F O >

< J

U R C O D E > 1 0 0 5 1 9 6 2 < / J U R C O D E >

< / _ G L B - R G T _ T A X C O D E S >

< / E 1 E

D K A 1 >

< E 1 E D K 0 2 S E G M E N T = " 1 " >

< Q U A L F > 0 0 1 < / Q U A L F >

< B E L N R > 4 5 2 0 0 2 2 0 7 2 < / B E L N R >

< D A T U M > 2 0 0 7 0 5 1 8 < / D A T U M >

< U Z E I T > 1 4 0 4 4 0 < / U Z E I T >

< / E 1

E D K 0 2 >

< E 1 E D K 1 8 S E G M E N T = " 1 "

>

< Q U A L F > 0 0 1 < / Q U A L F >

< T A G E > 3 0 < / T A G E >

< P R Z N T >

2 . 0 0 0 < / P R Z N T >

< / E 1 E D K 1 8 >

< E 1 E D P 0 1 S E G M E N T = " 1 " >

<

P O S E X > 0 0 0 1 0 < / P O S E X >

< A C T I

O N > 0 0 2 < / A C T I O N >

< P S T Y P > 0 <

/ P S T Y P >

< M E N G E > 1 0 0 . 0 0 0 < / M

E N G E >

< M E N E E > E A < / M E N E E >

< B M N G 2 > 1 0 0 . 0 0 0 < / B M N G 2 >

< P M E N E > E A < / P M E N E >

< V P R

E I > 1 0 < / V P R E I >

< P E I N H > 1 < / P

E I N H >

< N E T W R > 1 0 0 0 < / N E T W R >

< N T G E W > 8 0 0 < / N T G E W >

< G E W E I > K G M < / G E W E I >

< M A T K

L > P 2 0 < / M A T K L >

< B P U M N > 1 < / B

P U M N >

< B P U M Z > 1 < / B P U M Z >

< B R G E W > 1 0 0 0 < / B R G E W >

<

W E R K S > Z 2 0 3 < / W E R K S >

< E 1 E D P

0 4 S E G M E N T = " 1 " >

< M W S B T >

0 . 0 0 < / M W S B T >

< / E 1 E D P 0 4 >

< E 1 E D P 2 0 S E G M E N T = " 1 " >

< W M E N G > 1 0 0 . 0 0 0 < / W M E N G >

< A M E N G > 0 . 0 0 0 < / A M E N G >

< E D A T U > 2 0 0 7 0 5 1 8 < / E D A T U >

< E Z E I T > 1 4 5 0 0 0 < / E Z E I T >

< _ G L B - R G T _ S L I D 0 1 S E G M E N T = " 1 " >

< E T E N R > 0 0 0 1 < / E T E N R >

< / _ G L B - R G T _ S L I D 0 1 >

< / E 1 E D P 2 0 >

< E 1 E D P 1 9 S E G

M E N T = " 1 " >

< Q U A L F > 0 0 1 < / Q

U A L F >

< I D T N R > 0 0 0 0 0 0 0 0 0 0

4 3 0 0 0 0 9 8 < / I D T N R >

< K T E X T

> C a r t o n s - C e r e a l s M i l k 2 4 x 4 5 0

g < / K T E X T >

< / E 1 E D P 1 9 >

< E 1 E D P 1 9 S E G M E N T = " 1 " >

< Q U A L F > 0 0 3 < / Q U A L F >

< I D

T N R > 0 7 6 1 2 2 9 7 0 1 6 1 1 9 < / I D T N R >

< / E 1 E D P 1 9 >

< / E 1 E D P 0 1 >

< E 1 E D S 0 1 S E G M E N T = " 1 " >

< S

U M I D > 0 0 2 < / S U M I D >

< S U M M E > 1

0 0 0 < / S U M M E >

< S U N I T > E U R < / S

U N I T >

< / E 1 E D S 0 1 >

< E 1 E D S

0 1 S E G M E N T = " 1 " >

< S U M I D > 0 0

5 < / S U M I D >

< S U M M E > 0 < / S U M M E

>

< / E 1 E D S 0 1 >

< / I D O C >

< / _ G L

B - R G T X _ O R D E R S C P G >

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jun 12, 2007 at 09:40 AM

    Are you sure that file is in UTF-16? The declaration is UTF-8. Change the declaration to UTF-16, so it should work.

    Regards

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2007 at 06:46 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2007 at 06:52 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2007 at 06:57 AM

    Hi Saurabh,

    your xml is not wellformed coz there are spaces in the prolog between the first character '<' and the '?'. Coz of any reason there are spaces between all characters, that is making your document not readable for parsers including IE. For your task to convert to UTF-8 you can use a XSLT mapping with element "output" and attribut "encoding"

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    	<xsl:output encoding="UTF-8"/>
    	<xsl:template match="/">
    ...

    Regards,

    Udo

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.