Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 198072 - Messed up line ending characters
Messed up line ending characters
Status: RESOLVED FIXED
Product: cnd
Classification: Unclassified
Component: Project
7.0
PC Windows 7 x64
: P3 (vote)
: 7.2
Assigned To: Alexander Simon
issues@cnd
POST_RELEASE_PROCESSED
:
Depends on: 199534
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-25 21:50 UTC by mwisnicki
Modified: 2012-04-02 18:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mwisnicki 2011-04-25 21:50:08 UTC
I have created C++ project with existing sources on remote host.

Configured projects seems to have UTF-8 set as default encoding and newly created source files (.c, .h) have Unix line endings.

Empty files, XML project files in nbproject/*.xml and .gitignore are however written with Dos line separator.

I guess everything should have Dos endings even though I would actually prefer Unix endings.

Handling of file encodings and line separators in NetBeans is completely f*cked up and awfully frustrating. Someone really have to fix bug 72515 ASAP and introduce real control over it.
Comment 1 Alexander Pepin 2011-04-26 14:08:16 UTC
Indeed this is a duplicate of bug #72515

*** This bug has been marked as a duplicate of bug 72515 ***
Comment 2 mwisnicki 2011-04-26 17:14:05 UTC
Not really. Bug #72515 is about having control. This bug is about having consistency.

It is likely that fixing #72515 won't have any effect here, as it looks like editors for C/C++ ignore global line separator settings.
Comment 3 mwisnicki 2011-04-27 20:06:56 UTC
Oh and I have feature request that sits somewhere between this bug and bug 72515.
Assuming that per-project line-separator and encoding (are/will be) implemented:

when doing remote development, those settings should default to remote platform values (usually unix + UTF-8) and not those of development host where the IDE is running (often Win/Mac).
Comment 4 Leonid Lenyashin 2011-05-31 13:47:55 UTC
May have a very negative impact on OSS windows distribution if confirmed.
Comment 5 Vladimir Kvashin 2011-05-31 15:11:34 UTC
(In reply to comment #3)
> ...
> when doing remote development, those settings should default to remote platform
> values (usually unix + UTF-8)
A project can have several configurations, remote platforms are per configurations (which is quite convenient when doing multy-platform development). But it has only one set of source files. This makes your proposal questionable...
Comment 6 Vladimir Kvashin 2011-05-31 15:36:57 UTC
I've made a small investigation. Here are just some facts.

I looked at line endings on Windows (in my case it was XP, but I believe this does not matter). I see that nearly all files that are created via "New >" submenu are created with Unix line endings. The only exception I saw so far is .xml file, which has Dos endings.

Xml files in project metadata has Dos line endings as well.

I also noticed that 6.9.1 behaves exactly the same.
Comment 7 Vladimir Kvashin 2011-05-31 15:53:46 UTC
In the case of full remote, it stores Windows CR/LF pairs in project metadata as well, which is definitely incorrect. (However, IDE on Unix seems to work ok with such files)
Comment 8 Alexander Simon 2011-06-16 15:29:01 UTC
Change sets:
201082:b19bef4134ad
201003:0af92d81cece
fix following problems:
- local source file created from template has platform LS
- full remote source file created from template has "\n" LS
Comment 9 Alexander Simon 2011-06-21 11:01:50 UTC
some cases was fixed.
other cases are blocked by Bug #199534.
Comment 10 Alexander Pepin 2011-07-06 14:00:46 UTC
No QA action needed.
Comment 11 Alexander Simon 2012-01-13 09:42:32 UTC
Blocking issue was fixed.
It seems cnd changes:
201082:b19bef4134ad
201003:0af92d81cece
can be roll backed.
Comment 12 Alexander Simon 2012-01-13 09:46:19 UTC
(In reply to comment #10)
> No QA action needed.
IMHO it is wrong.
QA tests should cover following cases:
- created full remote file on windows computer must have "\n" line separator for c/c++, xml, txt, and other file extensions.
Comment 13 Alexander Simon 2012-03-28 17:32:17 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/df6cfba97367


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo