eclipse-platform / eclipse-platform/eclipse.platform

File corruption when moving file accross projects that have different charsets

Open
#581 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
165
Forks
174
Avg merge
2d 8h
Merged PRs (30d)
22

Description

### Current Behaviour
When moving a file across two projects with different charsets, a file with no specified charset gets corrupted.

### Reproducing*
```
Version: 2023-09 (4.29)
Build id: I20230711-0440
```
1) Create two projects
2) Set the default encodings of the projects, set them to different charsets
3) Create a file in one project
4) Move the file from one project to the other
5) See the File's implied charset not match the old implied charset

### Expected Behaviour
I propose this behaviour:
- When moving a file without explicitly set charset into a project where the new implicit charset would conflict with the current implicit charset, the old charset is set to an explicit charset in the file
- When moving a file with explicitly set charset into a project which has the same default charset as the explicitly set charset, unset the charset preference

--
This issue mirrors [this](https://bugs.eclipse.org/bugs/show_bug.cgi?id=380114) issue.
What do you think is the expected behaviour here? Do you agree with my proposal?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.