title: How to refer to a Chinese character in C code
body: <p>I have a C program that currently reads in Chinese text and stores them as <code>type wchar_t</code>. What I want to do is look for a specific character in the text, but I am not sure how to refer to the character in the code.</p>
  
  <p>I essentially want to say:</p>
  
  <pre><code>wchar_t character;
  
  if (character == 个) {
      return 1;
  }
  
  else return 0;
  </code></pre>
  
  <p>Some logic has been omitted, obviously. How would I go about performing such logic on Chinese in C?</p>
  
  <p>Edit: Got it to work. This code compiles with -std=c99, and prints out the character "个". </p>
  
  <pre><code>1 #include &lt;locale.h&gt;
  2 #include &lt;stdio.h&gt;
  3 #include &lt;wchar.h&gt;
  4 
  5 
  6 int main() {
  7         wchar_t test[] = L"\u4E2A";
  8         setlocale(LC_ALL, "");
  9         printf("%ls", test);
  10 }
  </code></pre>