3 ms·
Surely it depends on the encoding of the source, not where it was compiled?
by gpderetta 5y ago
Surely it depends on the encoding of the source, not where it was compiled?
- rawling 5y agoI think you're right: > Any line breaks within verbatim string literals are part of the resulting string. If the exact characters used to form line breaks are semantically relevant to an application, any tools that translate line breaks in source code to different formats (between "\n" and "\r\n", for example) will change application behavior. https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
- exyi 5y agoYes it does, but usually \n is committed in git, but on Windows it checks out as \r\n. So you are right that it technically does not depend on the system, but in practice there is a difference.
- gpderetta 5y agoThat's a very good point. Is it best practice to configure git to change line endings on Windows? I understand that these days Windows editors can handle unix line terminators corerctly.
- GoblinSlayer 5y agoAt least in visual studio this seems to be default and there's no way to change it.
- gpderetta 5y agoApparently it is possible, it is just very well hidden: https://stackoverflow.com/questions/3802406/configure-visual-studio-to-use-unix-line-endings https://stackoverflow.com/questions/3802406/configure-visual...
- GoblinSlayer 5y agoI mean git setting, not the text editor setting. Git checks out all files in CRLF format irrespective of your text editor.