title: Conversion from ASCII to Unicode char code (FreeType2)
body: <p>I'm using FreeType2 in one of my projects. In order to render a letter, I need to provide a Unicode two-byte character code. The char codes a program reads are in ASCII one-byte format though. It poses no problem for char codes below 128 (the character codes are the same), but the other 128 do not match. For instance:</p>
  
  <p>'a' in ASCII is 0x61, 'a' in Unicode is 0x0061 - that's fine<br>
  'ą' in ASCII is 0xB9, 'ą' in Unicode is 0x0105 - completely different</p>
  
  <p>I was trying to use WinAPI functions there, but I must be doing something wrong. Here's a sample:</p>
  
  <pre><code>unsigned char szTest1[] = "ąółź"; //ASCII format
  wchar_t* wszTest2;
  int size = MultiByteToWideChar(CP_UTF8, 0, (char*)szTest1, 4, NULL, 0);
  printf("size = %d\n", size);
  wszTest2 = new wchar_t[size];
  MultiByteToWideChar(CP_UTF8, 0, (char*)szTest1, 4, wszTest2, size);
  printf("HEX: %x\n", wszTest2[0]);
  delete[] wszTest2;
  </code></pre>
  
  <p>I'm expecting a new wide string to be created, with no NULL at the end. However, the <i>size</i> variable always equals 0. Any idea what I'm doing wrong? Or maybe there's an easier way to solve the problem?</p>