gruntjs/grunt — pull request #710 by sorccu (2013-03-07 10:36:01+00:00)
Title: grunt.util.spawn breaks multibyte stderr/stdout when data event contents are joined

I ran into an issue where UglifyJS going through grunt.util.spawn would silently break Japanese strings at certain offsets. Most Japanese characters are at least 3 bytes long, and it turns out that where breakage occured, `spawn`'s data event would only get a partial UTF-8 string. Then, `grunt.util.spawn` would attempt to join these partial strings with the `+=` operator, creating broken UTF-8 strings.

I added a test case illustrating the problem, and then fixed it with Buffers in a separate commit.