title: Converting xml file data in js object
body: <p>I need some help. I have an app that takes *.xml file through input type file, and converts it into js object.
  To do that i am using FileReader and xml-js library from here <a href="https://www.npmjs.com/package/xml-js" rel="nofollow noreferrer">https://www.npmjs.com/package/xml-js</a></p>
  <p>Now I have two problems that I can't handle.</p>
  <ol>
  <li>xml file contains cyrillic symbols, in console they display as ������� ��� ���
  <a href="https://i.stack.imgur.com/URtkL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/URtkL.png" alt="enter image description here" /></a></li>
  </ol>
  <ol start="2">
  <li>The second problem is that, in some reasons, I can't set converted object in state.</li>
  </ol>
  <p>Here is my code:
  Handler and input for file:</p>
  <pre><code>handleFile = (event) =&gt; {
      let file = event.target.files[0];
      let reader = new FileReader();
      reader.readAsText(file);
      reader.onloadend = () =&gt; {
          let json = xmljs.xml2js(reader.result, {compact: true, spaces: 4});
          this.setState({
              file: json
          }, console.log ('file', json))
      }
  };
  
  render() {
  
      return (
          &lt;div&gt;
              &lt;input type=&quot;file&quot; onChange={this.handleFile}/&gt;
          &lt;/div&gt;
      )
  }
  </code></pre>
  <p>So what shouls I do to display cyrillic symbols and how to set the object in state?</p>