• Post Reply Bookmark Topic Watch Topic
  • New Topic

Identify Encoding of an XML document coming in as a stream  RSS feed

 
Anupam Bhatt
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an XML coming in a s a inputsource from which i get the characterstream and finally write that stream to a file using a "outputStream" [Note: I dont use FileWriter since it writes with default encoding.]and assuming the encoding as UTF-8.

Now this assumption of UTF-8 encoding has to be done away with and i need to identify the encoding specified in the XML document, so that i can write to the file using the same encoding.

Need some ideas to achive this, that is "How to get the encoding of an XML document coming in as a Characterstream".

Any help/pointers/ideas are appreciated and welcome..

Thanks,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!