2

I am trying to download an XML file(in my J2ME Application) from a location in the server. My problem is that, in the beginning of the XML file these characters-"", are getting appended.

Can anybody tell me where the problem lies??

DOK
  • 32,337
  • 7
  • 60
  • 92
pujakhemka
  • 123
  • 10

1 Answers1

1

This is a Byte Order Mark ( for UTF-8 encoded files). More specifically, as explained in the Wikipedia article I linked to, it identifies the text as UTF-8 but doesn't say anything about the byte order, because UTF-8 does not have byte order issues.

XML-capable software/editors should be able to detect and handle it. What program are you processing this file with?

edit: I just read in a comment to a different answer that the parser you use chokes on these characters. If that happens, you probably need to specify the encoding of the file when opening it (or, as a dirty hack you could just strip the first three bytes of the file stream before passing it to the parser).

Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561
  • Hi....Thanks a lot. Your answer resolved my problem to an extent. I just had to change the encoding while creating the XML file. Thanks again. – pujakhemka Dec 10 '09 at 07:05