title: How to do MD5 with foreign characters?
body: <p>So I am making my custom highscore board in mobile game, using unity engine. </p>
  
  <p>I setup my mysql database, and bought highscore asset from store, it works, but only with english user name. So basically it send user's name, score to .php script. </p>
  
  <p>But I want that script also can receive korean characters as user's nickname. My users will use korean characters too as nickname not only english characters. </p>
  
  <p>How can I achieve this?</p>
  
  <p>Here are codes.</p>
  
  <p>------------------(Highscore.cs  at unity side)</p>
  
  <pre><code>WWWForm rsFm = new WWWForm();
              rsFm.AddField("name",name);   
          // at here name field, I want to receive korean characters as well.
              rsFm.AddField("tables",tables);
              rsFm.AddField("hash",GetHash(name));
              WWW rs = new WWW(registerUserURL,rsFm);
              yield return rs;
  </code></pre>
  
  <p>..................</p>
  
  <pre><code>string GetHash(string usedString){ //Create a Hash to send to server
      MD5 md5 = MD5.Create();
      byte[] bytes = Encoding.ASCII.GetBytes(usedString+secretKey);
      byte[] hash = md5.ComputeHash(bytes);
  
      StringBuilder sb = new StringBuilder();
      for(int i = 0; i &lt; hash.Length; i++){
          sb.Append(hash[i].ToString("x2"));
      }
      return sb.ToString();
  </code></pre>
  
  <h2>    }</h2>
  
  <h2>RegisterUser.php</h2>
  
  <pre><code>&lt;?php
  include('ServerConnect.php');
  $connection = Connect();//Attempt to Connect to MYSQL Server &amp; DataBase
  
  //Get variables from unity
  $name = $_POST['name'];
  $date = strtotime(date("Y-m-d"));
  $tables = $_POST['tables'];
  //Security Check
  $hash = $_POST['hash'];
  if(CheckKey($hash,$name) == 'fail'){ //Check if hash is valid
      echo 'Security Failure'; exit;
  </code></pre>
  
  <h2>    }</h2>
  
  <h2>ServerConnect.php</h2>
  
  <pre><code>function CheckKey($hash,$name){  //Check weather Md5 hash matches
      global $secretKey; 
      $checkHash = md5($name.$secretKey);
      if(strcmp($checkHash,$hash) == 0){
          return 'pass'; //hash matches
      }else{
          return 'fail'; //hash failed
      }
  </code></pre>
  
  <h2>    }</h2>
  
  <p>When I input korean character and send, console Result says "Security Failure" at above code. </p>