searchturbine / phpwee-php-minifier

Open-source (BSD) PHP inline minifier functions for HTML, XHTML, HTML5, CSS 1-3 and Javascript. http://searchturbine.com/php/phpwee
Other
79 stars 46 forks source link

Ways to not encode latin characters ? #22

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi, some questions :

  1. Is there a way to not encode latin characters using PHPWee\Minify::html($str) ? All texts containing latin characters are encoded and i dont want that (mostly for DB and others stuff).
  2. Is there a way to minify part of html code without adding the additional doctype / html tags ?

Regards and keep on your good work !

TakiDDine commented 6 years ago

i had the same probleme , did you found the solution

ashucg commented 6 years ago

Hi @TakiDDine ,

Please explain your problem so that someone could take a look at it. Anyway, this repository is dead so don't expect a quick solution as only a bunch of guys are still around to answer your questions and maybe someone will provide you with a solution.

jonleverrier commented 6 years ago

@ashucg I'm having the same problem. It's hard to pin point exactly what is going wrong.

For example, I have a web page that is UTF-8 encoded. I have some text on the page that says 'Français'. If I turn on phpwee-php-minifier 'Français' becomes 'Français'. Some for other accents and special characters.

ashucg commented 6 years ago

@jonleverrier I will take a look at this as soon as I get some time

jonleverrier commented 6 years ago

that's appreciated @ashucg

in closing, when phpwee-php-minifier is running, it encodes certain characters correctly when using <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> (which is no longer supported with HTML5).

If phpwee-php-minifer is running and <meta charset="utf-8"> is used in replacement of the old html4/xhtml meta tag, certain characters are not encoded, as stated above.

ashucg commented 6 years ago

@jonleverrier thanks for mentioning that, it will definitely help me finding the issue.

ashucg commented 6 years ago

@jonleverrier you can check the update file here

jonleverrier commented 6 years ago

Thank you @ashucg. Encoding works great now.

ashucg commented 6 years ago

@jonleverrier you are most welcome, I will update you when I make any other changes to the file(s)