You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- ### Problem
Copying or creating a file with UTF-8 charatacters would raise an
encoding error when:
1) There is a collision and the user wants to see a diff.
2) The application has set its `Encoding.default_internal` to a
non-nil value.
### Context
In Rails applications, the `Encoding.default_internal` is set to
UTF-8. The `Encoding.default_external` will be used to transcode
a string because the `default_internal` is not nil. So doing
this would raise a `Encoding::UndefinedConversionError`
```ruby
content = "\xE2\x80\x99".force_encoding(Encoding::ASCII_8_BIT)
File.write("my_file.rb", content)
```
0 commit comments