title: PowerShell MySQL failed insert on Foreign Characters
body: <p>If I run the following MySQL insert, the Korean text is successfully inserted into the table</p>
  <pre><code>INSERT INTO `table` (`site`, `published`, `title`, `link`, `body`, `language`) VALUES ('something.com', '2021-09-02 02:11:01', '안녕하세요 월드입니다!', 'something.com', 'none', 'Korean');
  </code></pre>
  <p>but in powershell, the Korean text gets inserted into the table as <code>????? ?????!</code></p>
  <pre><code>function ConnectToDatabase([string]$user, [string]$pass, [string]$MySQLHost, [string]$database) {
      #write-host &quot;--------&quot;
      #write-host &quot;Connecting to database&quot; 
      # Load MySQL .NET Connector Objects 
      [void][system.reflection.Assembly]::LoadWithPartialName(&quot;MySql.Data&quot;) 
      # Open Connection 
      $connStr = &quot;server=&quot; + $MySQLHost + &quot;;port=3306;uid=&quot; + $user + &quot;;pwd=&quot; + $pass + &quot;;database=&quot;+$database+&quot;;Pooling=FALSE&quot; 
      try {
          $conn = New-Object MySql.Data.MySqlClient.MySqlConnection($connStr) 
          $conn.Open()
      } catch [System.Management.Automation.PSArgumentException] {
          write-host &quot;Unable to connect to MySQL server, do you have the MySQL connector installed..?&quot;
          write-host $_
          #Exit
      } catch {
          write-host &quot;Unable to connect to MySQL server...&quot;
          write-host $_.Exception.GetType().FullName
          write-host $_.Exception.Message
          #exit
      }
      #write-host &quot;Connected to MySQL database : $MySQLHost\$database&quot;
      #write-host &quot;--------&quot;
      return $conn 
  }
  $conn = ConnectToDatabase &quot;user&quot; &quot;pass&quot; &quot;127.0.0.1&quot; &quot;db&quot;
  $query='INSERT INTO `table` (`site`, `published`, `title`, `link`, `body`, `language`) VALUES (&quot;something.com&quot;, &quot;2021-09-02 02:11:01&quot;, &quot;안녕하세요 월드입니다!&quot;, &quot;something.com&quot;, &quot;none&quot;, &quot;Korean&quot;);'          
  $Command = New-Object MySql.Data.MySqlClient.MySqlCommand $query, $conn
  $null = $Command.ExecuteNonQuery()
  $conn.close()
  </code></pre>