Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-12

Line Endings

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Benito van der Zander

Hi,
Is there a way to preserve the line endings of edited files? I just switched from Windows to Linux and now Lazarus converts all files my files from crlf to lf which makes it difficult to commit them to the version control system. (and Mercurial is even worse than svn) There was a post three years ago on the mailing list that it isn't possible, but perhaps this changed.

And another problem I had and want to comment about (although I solved it already) are the AnsiToUtf8/Utf8ToAnsi-functions.
I used them to convert between between latin1 and utf-8, and even if that is wrong, i think, many people do that, since there is nowhere a warning that
they behave differently on Linux/Windows/Linux with cwstring. It is very confusing, that these functions can suddently change their behaviour
if you only include the translations-unit somewhere, and it is surely not "write
once, run everywhere"...

Benito van der Zander

Reply by email

Flávio Etrusco
to Benito van der Zander
Benito van der Zander wrote 8 lines
Hi, Is there a way to preserve the line endings of edited files? I just switched from Windows to Linux and now Lazarus converts all files my files from crlf to lf which makes it difficult to commit them to the version control system. (and Mercurial is even worse than svn) There was a post three years ago on the mailing list that it isn't possible, but perhaps this changed.

Regarding hg, did you remove the "working copies" (hg up null) and restored later or not?

-Fl?vio

Reply by email

Vincent Snijders
to Benito van der Zander: Is there a way to preserve the line endings of edited files? I just switched from Windows…
Benito van der Zander wrote
Hi, Is there a way to preserve the line endings of edited files? I just switched from Windows to Linux and now Lazarus converts all files my files from crlf to lf which makes it difficult to commit them to

Use svn:lineending is native, see for example:
http://www.zope.org/DevHome/Subversion/SubversionConfigurationForLineEndings

Show quoted text 7 lines
And another problem I had and want to comment about (although I solved it already) are the AnsiToUtf8/Utf8ToAnsi-functions. I used them to convert between between latin1 and utf-8, and even if that is wrong, i think, many people do that, since there is nowhere a warning that

Yes, that is misuse of AnsiUtf8, the documentation warns about that: http://lazarus-ccr.sourceforge.net/docs/rtl/system/ansitoutf8.html

I don't know what would be a better place to warn about it.

Vincent

Reply by email