diff --git a/src/JShrink/Minifier.php b/src/JShrink/Minifier.php index 55b3873..86734da 100644 --- a/src/JShrink/Minifier.php +++ b/src/JShrink/Minifier.php @@ -537,7 +537,7 @@ protected function saveRegex() */ protected static function isAlphaNumeric($char) { - return preg_match('/^[\w\$]$/', $char) === 1 || $char == '/'; + return preg_match('/^[\w\$\pL]$/', $char) === 1 || $char == '/'; } /** diff --git a/tests/Resources/jshrink/input/utf_chars.js b/tests/Resources/jshrink/input/utf_chars.js new file mode 100644 index 0000000..dd9dc8f --- /dev/null +++ b/tests/Resources/jshrink/input/utf_chars.js @@ -0,0 +1,11 @@ +var π = Math.PI, + ε = 1e-6, + radians = π / 180, + degrees = 180 / π; + +function sgn(x) { + + + var π = Math.PI; + return x > 0 ? 1 : x < 0 ? -1 : 0; +} \ No newline at end of file diff --git a/tests/Resources/jshrink/output/utf_chars.js b/tests/Resources/jshrink/output/utf_chars.js new file mode 100644 index 0000000..7efc0e8 --- /dev/null +++ b/tests/Resources/jshrink/output/utf_chars.js @@ -0,0 +1 @@ +var π=Math.PI,ε=1e-6,radians=π/ 180,degrees=180 / π;function sgn(x){var π=Math.PI;return x>0?1:x<0?-1:0;} \ No newline at end of file