summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-18 15:28:28 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-18 15:41:43 +0300
commitb894375c04eb138f4c541623e644be8364ff11de (patch)
tree803bce61bbf72d4af45f75faaf9d70fa862768d0
parent88354144785a2a36fa3afebe336e2c2635efedfc (diff)
downloadsql-parser-b894375c04eb138f4c541623e644be8364ff11de.zip
sql-parser-b894375c04eb138f4c541623e644be8364ff11de.tar.gz
sql-parser-b894375c04eb138f4c541623e644be8364ff11de.tar.bz2
Fixed test for PHP5.5-.
-rw-r--r--src/Lexer.php7
-rw-r--r--tests/Misc/UtfStringTest.php3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Lexer.php b/src/Lexer.php
index 0bdd2f5..aae95f1 100644
--- a/src/Lexer.php
+++ b/src/Lexer.php
@@ -23,6 +23,13 @@ if (!defined('USE_UTF_STRINGS')) {
define('USE_UTF_STRINGS', true);
}
+// Set internal character to UTF-8.
+// In previous versions of PHP (5.5 and older) the default internal encoding is
+// "ISO-8859-1".
+if ((defined('USE_UTF_STRINGS')) && (USE_UTF_STRINGS)) {
+ mb_internal_encoding('UTF-8');
+}
+
/**
* Performs lexical analysis over a SQL statement and splits it in multiple
* tokens.
diff --git a/tests/Misc/UtfStringTest.php b/tests/Misc/UtfStringTest.php
index 0d1ff78..174b988 100644
--- a/tests/Misc/UtfStringTest.php
+++ b/tests/Misc/UtfStringTest.php
@@ -14,8 +14,7 @@ class UtfStringTest extends TestCase
*
* @var UtfString
*/
- const TEST_PHRASE = 'Les naïfs ægithales hâtifs pondant à Noël où il ' .
- 'gèle sont sûrs d\'être déçus en voyant leurs drôles d\'œufs abîmés.';
+ const TEST_PHRASE = 'Les naïfs ægithales hâtifs pondant à Noël où il gèle sont sûrs d\'être déçus en voyant leurs drôles d\'œufs abîmés.';
/**
* The length of the sample phrase.