sqmk / pecl-jsmin

PHP PECL extension for JavaScript minification
Other
69 stars 21 forks source link

Unicode is not handled #14

Closed christophercook closed 8 years ago

christophercook commented 11 years ago

The following test will fail because jsmin() returns spaces (or other hidden character) where multibyte characters were originally. The original Jsmin claims to handle UTF-8 so I expected it to work here also.

--TEST-- Strings containing extended characters --FILE-- <?php $js = <<<JS var test="février"; JS; echo jsmin($js); --EXPECT-- var test="février";

Using PHP 5.3.10 (on Ubuntu server) with a UTF-8 encoded php file I get: var test="f vrier";

sqmk commented 11 years ago

I'll take a look and update accordingly.

Thanks! Definitely a valid test to check for.

hanoii commented 10 years ago

Very interested into this as it's making it a show stopper. It's been a while since I did C, code looks clear and I might give it a try but really a bit of out of time, any idea if you were able to look at this at all or whether you think the change is too wide or just local?

Thanks.

mangust404 commented 10 years ago

Bug confirmed with cyrillic characters in 0.1.1

Here is an example:

--TEST-- Strings containing cyrillic characters --FILE-- <?php $js = <<<JS var test="тест"; JS; echo jsmin($js); --EXPECT-- var test="тест";

osopolar commented 8 years ago

Any news on that? Since I haven't used c for too log, I guess I can't help on that, but maybe this helps: http://www.cprogramming.com/tutorial/unicode.html

c9s commented 8 years ago

good news! #40 is now working, waiting to be merged! :)

sqmk commented 8 years ago

Working on new release now.

sqmk commented 8 years ago

Tagged as 2.0.0. Pushed release to PECL. Thanks @c9s