title: Convert hexadecimal to unicode
body: <p>I am trying to read some text fields from an IFC format file, and all of them seem to be hexadecimal. (the result may be some russian text).</p>
  <p>I could find different posts describing how to convert to Ascii, and found also an answer on how to <a href="https://stackoverflow.com/a/27363408/7310000">convert from hexadecimal to string for unicode</a>, here is the code given :</p>
  <pre><code>public static string FromHexString(string hexString)
  {
      var bytes = new byte[hexString.Length / 2];
      for (var i = 0; i &lt; bytes.Length; i++)
      {
          bytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
      }
  
      return Encoding.Unicode.GetString(bytes); // returns: &quot;Hello world&quot; for &quot;48656C6C6F20776F726C64&quot;
  }
  </code></pre>
  <p>But it's not working for me, using this function, here is the result I got :
  <a href="https://i.stack.imgur.com/RAaii.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RAaii.png" alt="enter image description here" /></a></p>
  <p>The original string looks like that <code>\X2\0420043504310440043E\X0\</code>. I don't know what the <code>\X2\</code> and <code>\X0\</code> mean, but I guess (wrong?) it is specific to IFC format to define the coding???</p>