Monodevelop: embedded resource line-ending CRLF converted to LF?
Asked Answered
O

1

0

I have a resource which isn't exactly textual. It's a file with some texts in it and some ansi control code. In my program I'm processing it as a binary file. However, I found that when I load it with System.Resources.ResourceManager.GetObject() as a byte[], all CRLFs are converted to LFs. This is not exactly what I want. I wonder if it's happening at compile time or runtime.

The same project works fine on Xamarin on Windows and OS X. No conversion is happening. It's only happening on Linux. And I'm sure the file on the disk does contain CRLFs. I checked the file size against the size of the byte[] loaded by ResourceManager.

Any ideas how to prevent this from happening? Thanks.

Outcast answered 10/7, 2014 at 17:39 Comment(0)
S
0

This behavior depends on setting Options->Text Editor->General->Line ending convetion:

You probably have this settings set to "Always convert line endings" and you probably want either "Leave line endings as is" or "Always ask for conversion".

This could also be connected to your GIT settings which converts all line endings to LFs during checkout. See "git config core.eol" and "git config core.autocrlf" for more informations.

Silveira answered 11/7, 2014 at 14:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.