webxl / grunt-reload

A grunt task and reverse proxy that enables live reloading of updated files in the browser.
MIT License
132 stars 19 forks source link

Fix a bug when HTML contains multibyte characters #14

Closed qhwa closed 11 years ago

qhwa commented 11 years ago

Given HTML like this:

<body>中文字符中文字符中文字符中文字符中文字符中文字符</body>

The entire output HTML of reload server will be:

<body>中文字符中文字符中文字符中文字符中文字符中文字符

There are some characters missing because of the byte length counting method. I have modified tasks/reload.js to support UTF-8 charset files. Please make a review at this, thanks!

nitoyon commented 11 years ago

This patch works fine on my machine with Japanese characters.