Hellbovine

Well-Known Member
For all you coders out there, when I was working with LPC I had to learn to convert all my code files into Linux LF rather than using the default Windows CRLF, or else in rare scenarios it can cause issues. I have a few questions related to this in NTLite.

1) Should .bat and .reg files use Windows CRLF?

2) Does NTLite code care about this, such as if I import a .reg file?

3) Also, in that code I had to end all of my files with a newline or sometimes you can get oddball errors...Does Windows require files to end in newlines too, in order to prevent niche problems? And what about NTLite, is it possible that if you don't have newlines on files we import or something of that nature, could it potentially cause an issue?
 
Last edited:
I searched the forum after I posted this and found a reply by Garlin (link) where this issue appeared! I'm curious to learn more about this.
 
Last edited:
Most Windows programs ignore the character encoding & CRLF style. The notable exception being Registry 5 files.
The rule of thumb is if it looks wrong in Notepad, some Windows app won't like it.

Registry 4 files are ANSI (or "ASCII") format.

Registry 5 files are Unicode (for international languages). Technically it's UTF-16, little-ended with BOM (byte order marker). There's a big difference when you open a reg file EXPORTED by regedit, vs making a new one in Notepad.

If you're editing a file created by another app, your editor should save it back in the same format. But if you're making a new registry or text file, pay attention to the encoding format when it's saved.
 
Oh very interesting. I had a mix of .reg files, some of them were UTF-16 LE because I exported them from regedit, then kept adding more to the file, but some others I had just used Windows Notepad to save as a .reg extension and those default to UTF-8. I didn't experience any issues so far, but I'm OCD about this kind of stuff so I'm going to fix them all now lol.
 
Last edited:
Back
Top