paolochiodi / htmlcompressor

A work in progress port of google's htmlcompressor.jar
Other
150 stars 26 forks source link

Change Content-Length header computation to be based on a number of bytes #9

Closed michaelbaudino closed 11 years ago

michaelbaudino commented 11 years ago

... instead of a number of characters (which is not always the same, e.g. with accented characters)

The bug appeared when using Middleman (the gem middleman-minify-html uses htmlcompressor). See here : http://forum.middlemanapp.com/t/middleman-minify-html-content-length-header-error/697

Also, check this IRB session for a quick example:

2.0.0-p247 :001 > 'é'.length => 1 2.0.0-p247 :002 > 'é'.bytesize => 2

michaelbaudino commented 11 years ago

Crap, I just saw #7 which is exactly the same fix :-/

paolochiodi commented 11 years ago

fixed in #7 thank you