title: Chinese Characters Displayed as Questions Marks in Mac Terminal
body: <p>I am trying to retrieve some UTF-8 uni coded Chinese characters from a database using a Java file. When I do this the characters are returned as question marks.</p>
  
  <p>However, when I display the characters from the database (using <code>select * from ...</code>) the characters are displayed normally. When I print a String in a Java file consisting of Chinese characters, they are also printed normally.</p>
  
  <p>I had this problem in Eclipse: when I ran the program, the characters were being printed as question marks. However this problem was solved when I saved the Java file in UTF-8 format.</p>
  
  <p>Running "locale" in the terminal currently returns this: </p>
  
  <pre><code>LANG="en_GB.UTF-8"
  LC_COLLATE="en_GB.UTF-8"
  LC_CTYPE="en_GB.UTF-8"
  LC_MESSAGES="en_GB.UTF-8"
  LC_MONETARY="en_GB.UTF-8"
  LC_NUMERIC="en_GB.UTF-8"
  LC_TIME="en_GB.UTF-8"
  LC_ALL=
  </code></pre>
  
  <p>I have also tried to compile my java file using this:</p>
  
  <pre><code> javac -encoding UTF-8 [java file] 
  </code></pre>
  
  <p>But still, the output is question marks.</p>
  
  <p>It's quite strange how it will only sometimes display the characters. Does anyone have an explanation for this? Or even better, how to fix this so that the characters are correctly displayed? </p>