saros icon indicating copy to clipboard operation
saros copied to clipboard

Different default encodings causing inconsistency

Open m273d15 opened this issue 5 years ago • 1 comments
trafficstars

Describe the bug If one user shares a project (with the setting "inherit from container") containing a special character as Ö where the systems default encoding is UTF-8 (Linux) and the other participant uses a system with another encoding (Windows) an inconsistency occurs, because different encodings are used.

Expected behavior ?

m273d15 avatar Nov 28 '19 16:11 m273d15

I guess is the last challenge if this ******** encoding stuff. If I am not mistaken this might still broken for partial sharing so what we currently have is:

You get a warning if the remote (sharing side) offers you a project that has encodings that the local side do not support.

I remember I started a patch (based on Tobias commit for exchanges IntelliJ stuff) that also uses this hook. There we could also add this information. However we ran into an issue.

I do not know what is written in the meta files for the default encoding. Even changing the default encoding to match the remote side causes unwanted side effects because if you change one file encoding afterwards the remote side will get the whole meta file replaced, containing the change for the specific file and also the whole project encoding which is now not the default but the encoding from the receiving side, i.e

Alice sends Bob a project, Bob changes the Encoding to match Alice (metafile is not replaced yet because the project is not shared yet on Bobs side) Bob changes the encoding of a specific file. Bob changes the default encoding (OS setting) of Alice settings (because the whole meta file is NOW replaced on Alice Side).

Alice meta file now contains Bob default encoding (which still matches the default encoding, however it is now explicitly set, e.g if the default encoding is set to OS specific it is now set to UTF-8).

I still do not think that it is worth to put much effort into this issue because in big project (even in ours) it is explicitly set what encoding is used and this case is already covered, i.e you get a warning.

srossbach avatar Nov 29 '19 20:11 srossbach