Remove windows encoding from `.php` files
[hiphop-php.git] / hphp / test / zend / bad / ext / pdo_mysql / tests / pdo_mysql_connect_charset.php
blob0574eca663d3e68770035f43ec17122ad1c7e58f
1 <?php
2 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
4 /* Connect to mysql to determine the current charset so we can diffinate it */
5 $link = MySQLPDOTest::factory();
6 $charset = $link->query("SHOW VARIABLES LIKE 'character_set_connection'")->fetchObject()->value;
8 /* Make sure that we don't attempt to set the current character set to make this case useful */
9 $new_charset = ($charset == 'latin1' ? 'ascii' : 'latin1');
11 /* Done with the original connection, create a second link to test the character set being defined */
12 unset($link);
14 $link = MySQLPDOTest::factory('PDO', false, null, Array('charset' => $new_charset));
15 $conn_charset = $link->query("SHOW VARIABLES LIKE 'character_set_connection'")->fetchObject()->value;
17 if ($charset !== $conn_charset) {
18 echo "done!\n";
19 } else {
20 echo "failed!\n";