A Wine'd program lets me create/edit some script for it to execute. All I need to do is click on 'Edit Script', then it pops up its own little editor for me to type in. Strange things is after I finished editing something and save, it complains that some character is wrong. I can't see/find anything wrong. I saved it anyway and reopen it without changing anything, then the program is OK with it and the script actually executes fine. Seems most likely it has to do with line-change character because if I just edit some letters on a same line, it seems OK. Anyone please advise what to do to correct the problem?
Are you editing UNIX files in a Windows program? In that case, it might be adding the "carriage return" character at the end of every line once you save it. Why? Well, here's why. Text files in Windows and Linux have a very minor difference: the way they store "newlines". Linux uses the LF character (line feed). Windows uses TWO characters to indicate a line break: CR (carriage return) and LF (line feed). Usually, when you try editing a text file that has only LF characters as newlines, Windows apps will behave differently depending on whether they support "seeing" this character: - Notepad doesn't recognize them as newlines at all and glues all text together; - Some editors recognize it correctly, then convert to CR+LF once you save the file; - Some other editors recognize the file correctly and let you save back to whatever format you were using (CR+LF, just LF, or just CR in case of Macs). Now, I'm not sure about this, but I think what is happening is you have an editor of the middle type - and it warns you about those UNIX-type newlines and converts them to Windows-type newlines.
Thanks for tips regarding different editors to use. Well, in my case, I have to use the editor provided by this Windows program, because it then saves it in its native format (not ASCII). I won't somehow I can type the CRLF on my Linux keyboard. A philosophical question: should Wine actually be the one to handle this issue because that is what makes possible to run Windows programs on a Linux system?
Martin, Thanks for the response. But sorry that was not what I was asking. The Windows program I am running with Wine provides an editor of its own. I need to use that because only it then can save into the proprietary (non-ASCII) format the program needs to use. Of course I could use other editors to edit but will have to copy/paste the text into the program's editor. A question for that is whether the CRLF get copied/pasted correctly. I hope if there is a way for me to use the Linux keyboard to type correctly into the program's editor.
Martin, Thanks for all the good suggestions. Unfortunately, the editor is launched from within the Windows program. The use of an outside editor in Linux that automatically puts the Windows required CRLF might be a good idea. Then I copy/paste the text into the editor provided by the program. I guess the copy/paste would also copy/paste CRLF. The question is what editor is the best choice for that. My philosophical question again: should Wine take the responsibility in putting the correct newline character? Seems to me that would solve the whole thing.
Anyone disagree that Wine should take care of adding in the right newline characters (CRLF) in a Wine'd editor (like for instance, Notepad)? The reason I propose that is because anyone who uses a wine'd editor to edit something intends to use the outcome in the Wine'd (Windows) environment. As Windows require CRLF as the newline, Wine simply passing through a Linux LF into the editor is not acceptable.