title: Writing Unicode to a file in C++
body: <p>I have a problem with writing unicode to a file in C++. I want to write to a file with my own extension a few smiley faces that you can get by typing ALT+NUMPAD(2). I can display it on CMD by making a char and assigning the value of '\2' to it and it will display a smiley face, but it won't write it to a file.</p>
  
  <p>Here is a snippet of code for my program:</p>
  
  <pre><code>ofstream myfile;
  myfile.open("C:\Users\My Username\test.exampleCodeFile");
  myfile &lt;&lt; "\2";
  myfile.close();
  </code></pre>
  
  <p>It will write to the file, but it wont display what I want. I would show you what it displays but StackOverflow won't let me display the character. Thanks in advance.</p>