lewisje / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Minify_YUICompressor cannot set charset UTF-8. (with patch) #184

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version: 2.1.3
PHP version: 5.2.12

UTF-8 charset option is ignored.
If some UTF-8 string in source, $output length is 0.

  $opt = array('charset' => 'UTF-8');
  $output = Minify_YUICompressor::minifyJs($source, $opt);

Patch this.

--- Minify/YUICompressor.php    2010-07-06 17:42:14.000000000 +0900
+++ Minify/YUICompressor.new.php        2010-07-08 00:53:15.000000000 +0900
@@ -110,7 +110,7 @@
         );
         $cmd = self::$javaExecutable . ' -jar ' . escapeshellarg(self::$jarFile)
              . " --type {$type}"
-             . (preg_match('/^[a-zA-Z\\-]+$/', $o['charset'])
+             . (preg_match('/^[a-zA-Z0-9\\-]+$/', $o['charset'])
                 ? " --charset {$o['charset']}"
                 : '')
              . (is_numeric($o['line-break']) && $o['line-break'] >= 0

Original issue reported on code.google.com by milly...@gmail.com on 7 Jul 2010 at 4:17

GoogleCodeExporter commented 9 years ago
Patched in R418. Thanks! How's the wrapper working for you?

Original comment by mrclay....@gmail.com on 8 Jul 2010 at 1:32

GoogleCodeExporter commented 9 years ago
Thanks patched.
I use with yuicompressor-2.4.2.jar works fine!

Original comment by milly...@gmail.com on 8 Jul 2010 at 7:40