rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.11k stars 552 forks source link

CreateFile#identical? fixed for files containing multi-byte UTF-8 codepoints #786

Closed tomclose closed 1 year ago

tomclose commented 2 years ago

🌈

Currently if you regenerate a file that contains a multi-byte UTF-8 codepoint (such as €) the file will falsely be identified as having changed. This PR adds a test to the create_file_spec to identify the problem, and then fixes the problem.

The change is the same as in https://github.com/rails/thor/pull/656, but that PR seems to have languished unmerged for just over 3yrs. I'm hoping the testing approach in the PR will address the previous objections so that the change can be merged.