Questions tagged [line-endings]
Line-ending signifies end of line. Depending on operating system line-endings are different.
line-endings
528
questions
1
vote
1
answer
63
views
How to recover per-line git blame history after line endings were changed to CR?
Multiple developers have contributed to a project over few years.
A few commits ago one commit has changed the line endings in a single file from our standard LF (0x10) to CR (0x13). Reason unknown.
...
0
votes
0
answers
55
views
When using [FromForm] line endings become \r\n - Can this be configured to only \n?
Our application consists of an angular frontend and a c# .net backend. We use textareas with characterlimits in the html file. Now to the problem:
In most places the text in the textarea is sent to ...
-2
votes
1
answer
118
views
Why is CURL not working in my Dockerfile when running docker compose build?
I work on a Windows machine, and I code mainly in Visual Studio Code. I am writing a Dockerfile and using a docker compose yml file with it, the image is on the latest ubuntu release. What I was ...
0
votes
1
answer
24
views
Project files via p4 have the wrong line endings
for an unknown reason the files I have downloaded via p4 have the wrong line endings (UNIX, I need Win) and won't compile in VS.
I have tried changing the line endings setting in "edit current ...
0
votes
1
answer
146
views
Running a shell script in a Docker container results in a "not found" error, even the script being located in the PATH environment
I have a Django application configured to run in a Docker container. In the Dockerfile, I copy a directory called scripts which contains a script commands.sh to the container, which is then added to ...
0
votes
0
answers
30
views
Gitattributes behaving weirdly for line endings (with gitlab)
I have many repositories in GitLab with Maven/Java projects in them.
A new colleague recently joined our team and we decided to add a .gitattributes file to the repositories to lessen the ...
2
votes
1
answer
245
views
How to find a substring index in a string with different line ending in Typescript
I have two strings
abc\r\ndef
c\nde
And I need to find index of string 2 inside string 1.
I can't obviously use indexOf(), so I need something that would work like it, but took different line ...
3
votes
0
answers
123
views
FormatMessageV() of CString replaces \n with \r\n
There is a function called as FormatMessageV which is part of CString class that is supposed to 'Format a message string using a variable argument list' according to MSDN.
Other than the said ...
1
vote
3
answers
154
views
Strings and here document have UNIX line endings on Windows
Both here documents and strings are using UNIX 0x0A line endings on Windows instead of 0x0D0A. How can I get them to be Windows line endings?
PS C:\> $s = @"
>> now
>> is
>> ...
1
vote
1
answer
268
views
How to prevent Python JSON .dumps() function from removing carriage return? [duplicate]
In Python, I'm attempting to read in a JSON file, change a single value, then do some further processing on the string returned from the .dumps() function. However, after calling json.dumps() the ...
1
vote
1
answer
272
views
Intellij IDEA Unix line endings for new files
How do you configure Intellij IDEA so that it will use Unix line endings for all source files it creates in the future? The Google search results all refer to the way to convert an existing file to ...
1
vote
1
answer
745
views
How to fix the line ending style (either CRLF or LF) in Python when written a text file?
I have the following little program in Python
from pathlib import Path
filename = Path("file.txt")
content = "line1\nline2\nline3\n"
with filename.open("w+", encoding=&...
2
votes
1
answer
106
views
Where in the documentation/spec does it describe how '\n' is converted in text-mode to platform-specific line-endings?
I know, from experience, that the following code:
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
return 0;
}
results in different line-endings being ...
5
votes
1
answer
135
views
Adding comma between quotes (format) in printf changes the output?
I am facing a very weird issue that i can only produce on linux. I really couldnt find anything like it on the internet, but if my searching skills are not good enough, I apologize if this was a ...
4
votes
0
answers
116
views
Is there a way to set the default line ending for GitHub Copilot?
I am trying out GitHub Copilot on a project that uses CRLF for all line endings. Copilot often suggests other line endings (CR or LF). Is there a way to configure or tell Copilot to only use a certain ...