Skip to content

utf8 identical checking #656

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

Closed
wants to merge 2 commits into from
Closed

utf8 identical checking #656

wants to merge 2 commits into from

Conversation

chenkovsky
Copy link

File.binread returns string with ASCII-8BIT encoding. but the rendered result is Utf8 encoding. For non-ascii characters, although the content is same, the comparison will return false. when we invoke migration generate with force option. it will delete the old migration file, and create a new migration file with the same content.

@deivid-rodriguez
Copy link
Contributor

@chenkovsky Can we add a test for this change, so it doesn't break again in the future?

@chenkovsky
Copy link
Author

@deivid-rodriguez I change the test. add utf8 character to content.

@deivid-rodriguez
Copy link
Contributor

Sorry for dropping the ball here.

For the test, I would personally prefer a new separate test that uses UTF-8 content, rather that changing every test to create a file with UTF-8 content.

Other than that this PR looks good to me.

@enigmatt-pl
Copy link

Heyy, just a little suggestion from me:

How about introducing a 'wrapper' method for File.binread(destination) and similar that output the earlier mentioned ASCII-8BIT? Ideally, we could force the output of binread to Encoding.default_external which would be more flexible for sure.

Regards

@rafaelfranca
Copy link
Member

Closed by #786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants