The encoding option was incorrect, because the plugin should treat files as binary not as strings. Instead, pass option "encoding: null" to grunt.file.read to request a buffer in return instead of a string.