title: Select unicode character u2028 in mysql 5.1
body: <p>I am trying to select unicdode character /u2028 in MySQL 5.1. MySQL 5.1 does support utf8 and ucs2.</p>
  
  <p>In newer versions of MySQL i could select the char just be using utf16 or utf32 collation:</p>
  
  <pre><code>SELECT char(0x2028 using utf16);
  SELECT char(0x00002028 using utf32);
  </code></pre>
  
  <p>But MySQL 5.1 do not support utf16 and utf32. How could I select the unicode character then?</p>
  
  <p>Perhaps a few words about my use case: I have an third party application which stores data in a mysql database and using JavaScript for user interface. The application do not deal with the problem unicode characters /u2028 and /u2029 are valid JSON but will break JavaScript code. (For details see <a href="http://timelessrepo.com/json-isnt-a-javascript-subset">http://timelessrepo.com/json-isnt-a-javascript-subset</a>) So I like to know how much data is affected by that issue and perhaps use replace on MySQL to fix it.</p>
  
  <hr>
  
  <p>To demonstrate the problem:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `test` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `string` varchar(100) CHARACTER SET utf8 NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
  
  INSERT INTO `test` (`id`, `string`) VALUES
  (1, 'without U+2028'),
  (2, 'with U+2028 at this "     "point');
  
  SELECT * FROM test WHERE string LIKE CONCAT("%", char(0x2028 using utf16), "%");
  // returns row 2 as expected
  
  SELECT * FROM test WHERE string LIKE CONCAT("%", char(??? using utf8), "%");
  // U+2028 in utf8 is 0xE2 0x80 0xA8 isn't it?
  // But how to parse this to char function?
  </code></pre>