summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Lexer.php7
1 files changed, 7 insertions, 0 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.