{"action":"opened","issue":{"url":"https://api.github.com/repos/erickrdch/grunt-string-replace/issues/29","labels_url":"https://api.github.com/repos/erickrdch/grunt-string-replace/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/erickrdch/grunt-string-replace/issues/29/comments","events_url":"https://api.github.com/repos/erickrdch/grunt-string-replace/issues/29/events","html_url":"https://github.com/erickrdch/grunt-string-replace/issues/29","id":59535020,"number":29,"title":"string-replace replacing unmatched characters","user":{"login":"iabw","id":1054569,"avatar_url":"https://avatars.githubusercontent.com/u/1054569?v=3","gravatar_id":"","url":"https://api.github.com/users/iabw","html_url":"https://github.com/iabw","followers_url":"https://api.github.com/users/iabw/followers","following_url":"https://api.github.com/users/iabw/following{/other_user}","gists_url":"https://api.github.com/users/iabw/gists{/gist_id}","starred_url":"https://api.github.com/users/iabw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iabw/subscriptions","organizations_url":"https://api.github.com/users/iabw/orgs","repos_url":"https://api.github.com/users/iabw/repos","events_url":"https://api.github.com/users/iabw/events{/privacy}","received_events_url":"https://api.github.com/users/iabw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-02T19:36:35Z","updated_at":"2015-03-02T19:36:35Z","closed_at":null,"body":"'string-replace' logged that it had 'created' all of the files in my specified directory, even though none of the files actually matched my replacement config.\r\n\r\nIn some of those files, this saving process over-wrote some characters in my files with some other character that's showing up in my text editor as �, despite my config for string-replace specifying a specific string to replace. The replaced characters included smart quotes and a copyright symbol. It is still showing up \"correctly\" in the browser, so maybe it's just different flavors of unicode or something? I'm not an expert on this topic.\r\n\r\nInterestingly, svn revert isn't fixing this character difference, so whatever 'string-replace' did to the smart-quote, svn doesn't seem to know it's different for revert purposes, although it DOES know it's different for saying the file has been modified ( which it shouldn't have been in the first place ).\r\n\r\nmy config looked like this -\r\n\r\n    \"string-replace\": {\r\n\t\t\tvelocity: {\r\n\t\t\t\tfiles: [{\r\n\t\t\t\t\texpand: true,\r\n\t\t\t\t\tcwd: \"templates/velocity/\",\r\n\t\t\t\t\tsrc: ['**/*.vm'],\r\n\t\t\t\t\tdest: 'templates/velocity/'\r\n\t\t\t\t}],\r\n\t\t\t\toptions: {\r\n\t\t\t\t\treplacements: [{\r\n\t\t\t\t\t\tpattern: \"#set($template_version =\",\r\n\t\t\t\t\t\treplacement: '\"#set($templateVersion =\"'\r\n\t\t\t\t\t}]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\nI would think that, ideally, grunt-string-replace would not save a file that it didn't think it was performing a replacement in. I saw it trigger my grunt-watch on my templates/velocity folder, and it seems like it would also not interact properly with grunt-newer."}}