title: encoding errors in chinese text from xml
body: <p>I am creating xml files that contain chinese posts and it seemed to be working but I started getting an error:</p>
  
  <p>This page contains the following errors:</p>
  
  <p>error on line 4165 at column 25: Input is not proper UTF-8, indicate encoding !
  Bytes: 0x0B 0xC3 0xA5 0xC2
  Below is a rendering of the page up to the first error.</p>
  
  <p>When trying to open some of the resulting files.The line it references contains chinese characters and this occurs only in some situations and my guess is that the text is sometimes containing some characters that throw it off. How can I ensure that the text for that field will always be properly encoded? I don't even understand why the issue yet.</p>
  
  <pre><code> Public Shared xwriter As XmlTextWriter = New XmlTextWriter(xmlfile, Encoding.UTF8)
  </code></pre>
  
  <p>I make sure the xmltextwriter is properly declared.</p>
  
  <p>EDIT:</p>
  
  <p>The issue is that I use vb.net and apparantly it encodes everything in utf-16 so I assume this is fine. The problem is that the text I am receiving is probably double encoded or incorrectly encoded and I need to clean it before using it; so that my xml is valid.</p>
  
  <p>EDIT:</p>
  
  <p>so if I need to fix my data, my question is how can I detect what encoding is used for a specific text and how do I convert into utf8 format that can be viewed in an xml file and make the file valid.</p>