-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File encoding changes on replace #23
Comments
Hi Nabil, Thanks for your message. I wanted to ask are you seeing any faulty behaviour as a result of using grunt.text.replace? Also, how are you checking what the file encoding is? Note that Unicode is a character set and UTF-8 is an encoding that uses the Unicode character set. See the difference between UTF-8 and Unicode. As for grunt.text.replace, it uses grunt.file.copy to write files, both for overwriting and creating new files. Grunt.file.copy uses UTF-8 as a default character encoding, so all files should be UTF-8. You can see the replacement code here. Let me know if you track down the issue any further, and if you need any help. If anything needs changing feel free to fork and submit a pull request. I'm going to mark this issue as closed but reopen if you feel there still exists a problem, and if you could provide a bit more information about the problems you're seeing. Thanks, Jonathan |
Sorry didn't explain very well but this is related to #16 |
Are you able to merge this pull request and release a new version to npm please? |
I am trying to run a replace with overwrite option set to true. This works but for all files including the ones where there were no matches it will change the file encoding from UTF8 to unicode. Any ideas why this is happening? Ideally I would not want the encoding to change at all, especially for files with no matches should not be touched.
Thanks
The text was updated successfully, but these errors were encountered: