[OSM-dev] Line endings on Windows for OSM files
Jochen Topf
jochen at remote.org
Thu Aug 27 16:21:16 UTC 2015
On Mi, Aug 26, 2015 at 04:37:04 +0200, Andreas Labres wrote:
> On 25.08.15 14:00, Jochen Topf wrote:
> > I am working on the libosmium C++ library. It can read and write all sorts of
> > OSM files. And it works on Windows. No I have been asking myself whether I am
> > using the "right" line endings on Windows. Unix normally has LF, Windows has
> > CRLF. So does that mean I should write OSM XML files with CRLF on Windows.
> > Does Osmosis do it that way? Other programs? What about when I download a
> > planet file or call the OSM API? Does the browser magically convert the LFs
> > in those files into CRLFs? What about when the file is gzipped?
>
> \r\n would be the standard Windows line endings for text (and XML?) files. But
> most text etc. editors can handle both "Windows" (CRLF) and "Unix" (LF) line
> endings.
>
> As OSM files received via the API have Unix line endings and as JOSM uses (at
> least by default) Unix line endings - so it's always \n only - I think it would
> be kind of strange if the default wouldn't also be Unix line endings for your lib.
>
> Browsers don't change line endings (if you save an OSM file received via the
> API, you get \n only). Only FTP programs convert if text (not binary!) transfer
> mode is used.
Thanks all for the infos. I am going with simple LF endings on Windows. The next
libosmium version will do that consistently.
Jochen
--
Jochen Topf jochen at remote.org http://www.jochentopf.com/ +49-351-31778688
More information about the dev
mailing list