title: From collation Modern_Spanish_CI_AI (in SQL Server) to UTF-8 (in MySQL)
body: <p>I am writing a PHP script to import some data from a Microsoft SQL Server database to my MySQL database.</p>
  
  <p>Collation in the SQL Server is Modern_Spanish_CI_AI (so I guess the encoding is ASCII), and in my MySQL database I'm using UTF-8 encoding and utf8_unicode_ci as collation.</p>
  
  <p>When I import the data I get wrong characters corresponding to the Spanish letter Ñ. I've tried to use the PHP functions utf8_encode($string) and mb_convert_encoding($string, "UTF-8") without any success, (I got different wrong characters but still wrong).</p>
  
  <p>Perhaps this helps:
  Table's definition in SQL Server:</p>
  
  <pre><code>CREATE TABLE [dbo].[myTable] (
  [myField] varchar(2) COLLATE Modern_Spanish_CI_AS NOT NULL,
  </code></pre>
  
  <p>Table's definition in MySQL</p>
  
  <pre><code>CREATE TABLE `myTable` (
  `myField` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
  </code></pre>