title: How to convert TCVN string to Unicode string
body: <p>I have tried to convert TCVN string to Unicode string but no success. And this is my code which can support converting TCVN string to Unicode string:</p>
  
  <pre><code>class Converter
  {
      private static char[] tcvnchars = {
      'µ', '¸', '¶', '·', '¹',
      '¨', '»', '¾', '¼', '½', 'Æ',
      '©', 'Ç', 'Ê', 'È', 'É', 'Ë',
      '®', 'Ì', 'Ð', 'Î', 'Ï', 'Ñ',
      'ª', 'Ò', 'Õ', 'Ó', 'Ô', 'Ö',
      '×', 'Ý', 'Ø', 'Ü', 'Þ',
      'ß', 'ã', 'á', 'â', 'ä',
      '«', 'å', 'è', 'æ', 'ç', 'é',
      '¬', 'ê', 'í', 'ë', 'ì', 'î',
      'ï', 'ó', 'ñ', 'ò', 'ô',
      '­', 'õ', 'ø', 'ö', '÷', 'ù',
      'ú', 'ý', 'û', 'ü', 'þ',
      '¡', '¢', '§', '£', '¤', '¥', '¦'
  };
  
      private static char[] unichars = {
      'à', 'á', 'ả', 'ã', 'ạ',
      'ă', 'ằ', 'ắ', 'ẳ', 'ẵ', 'ặ',
      'â', 'ầ', 'ấ', 'ẩ', 'ẫ', 'ậ',
      'đ', 'è', 'é', 'ẻ', 'ẽ', 'ẹ',
      'ê', 'ề', 'ế', 'ể', 'ễ', 'ệ',
      'ì', 'í', 'ỉ', 'ĩ', 'ị',
      'ò', 'ó', 'ỏ', 'õ', 'ọ',
      'ô', 'ồ', 'ố', 'ổ', 'ỗ', 'ộ',
      'ơ', 'ờ', 'ớ', 'ở', 'ỡ', 'ợ',
      'ù', 'ú', 'ủ', 'ũ', 'ụ',
      'ư', 'ừ', 'ứ', 'ử', 'ữ', 'ự',
      'ỳ', 'ý', 'ỷ', 'ỹ', 'ỵ',
      'Ă', 'Â', 'Đ', 'Ê', 'Ô', 'Ơ', 'Ư'
  };
  
      private static char[] convertTable;
  
      static Converter()
      {
          convertTable = new char[256];
          for (int i = 0; i &lt; 256; i++)
              convertTable[i] = (char)i;
          for (int i = 0; i &lt; tcvnchars.Length; i++)
              convertTable[tcvnchars[i]] = unichars[i];
      }
  
      public static string TCVN3ToUnicode(string value)
      {
          char[] chars = value.ToCharArray();
          for (int i = 0; i &lt; chars.Length; i++)
              if (chars[i] &lt; (char)256)
                  chars[i] = convertTable[chars[i]];
          string rstr = new string(chars);
          return rstr;
      }
  }
  </code></pre>
  
  <p>The code above is not reliable and it gives a wrong converting of TCVN string </p>
  
  <p><strong>Explanation:</strong> </p>
  
  <p>I have tried to use the code above to convert TCVN string</p>
  
  <ul>
  <li><p>TCVN String: "C§  ngh̉ tØnh Bµ R̃a- Ṿng Tµu" </p></li>
  <li><p>Required result: "CĐ nghề tỉnh Bà Rịa - Vũng Tàu"</p></li>
  <li><p>Wrong result: "CĐ ngh̉ tỉnh Bà R̃a- Ṿng Tàu".</p></li>
  </ul>
  
  <p>Example in code of calling function:</p>
  
  <pre><code>//Original string
  var tcvnStr = "C§  ngh̉ tØnh Bµ R̃a- Ṿng Tµu";
  var unicStr = Converter.TCVN3ToUnicode(tcvnStr);
  //The result of unicStr should be "CĐ nghề tỉnh Bà Rịa - Vũng Tàu"
  </code></pre>
  
  <p><strong>Issue:</strong> 
  The code above give a wrong result of converting TCVN string to Unicode string.</p>
  
  <p><strong>Requirement:</strong> </p>
  
  <p>I need your help to convert TCVN string to Unicode string.</p>
  
  <p>Sincerely,
  Dung Tri</p>