{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/2172","repository_url":"https://api.github.com/repos/ocaml/ocaml","labels_url":"https://api.github.com/repos/ocaml/ocaml/issues/2172/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/2172/comments","events_url":"https://api.github.com/repos/ocaml/ocaml/issues/2172/events","html_url":"https://github.com/ocaml/ocaml/pull/2172","id":385504326,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NDYxMzc4","number":2172,"title":"Windows - Stdlib: Format function always uses LF newlines","user":{"login":"bryphe","id":13532591,"node_id":"MDQ6VXNlcjEzNTMyNTkx","avatar_url":"https://avatars1.githubusercontent.com/u/13532591?v=4","gravatar_id":"","url":"https://api.github.com/users/bryphe","html_url":"https://github.com/bryphe","followers_url":"https://api.github.com/users/bryphe/followers","following_url":"https://api.github.com/users/bryphe/following{/other_user}","gists_url":"https://api.github.com/users/bryphe/gists{/gist_id}","starred_url":"https://api.github.com/users/bryphe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryphe/subscriptions","organizations_url":"https://api.github.com/users/bryphe/orgs","repos_url":"https://api.github.com/users/bryphe/repos","events_url":"https://api.github.com/users/bryphe/events{/privacy}","received_events_url":"https://api.github.com/users/bryphe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-11-28T23:39:13Z","updated_at":"2018-11-29T10:50:08Z","closed_at":"2018-11-29T00:06:06Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/2172","html_url":"https://github.com/ocaml/ocaml/pull/2172","diff_url":"https://github.com/ocaml/ocaml/pull/2172.diff","patch_url":"https://github.com/ocaml/ocaml/pull/2172.patch"},"body":"The `Format` standard library module always uses `\\n` for newlines.\r\n\r\nThis came up in facebook/reason#1518 - the  `Format` module is used to pretty-print and output to a file. Some related discussion there.\r\n\r\nI believe that, on Windows, we'd want to use the CRLF `\\r\\n` character for newlines - are there any concerns with making this change?\r\n\r\nIn addition, I was wondering if it would make sense to expose the platform newline via the stdlib via `Sys.eol`? It might already be available in a module, but I was unable to find it.\r\n\r\nPlease let me know if you have any feedback or concerns.\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/comments/442790183","html_url":"https://github.com/ocaml/ocaml/pull/2172#issuecomment-442790183","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/2172","id":442790183,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mjc5MDE4Mw==","user":{"login":"jberdine","id":1466830,"node_id":"MDQ6VXNlcjE0NjY4MzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1466830?v=4","gravatar_id":"","url":"https://api.github.com/users/jberdine","html_url":"https://github.com/jberdine","followers_url":"https://api.github.com/users/jberdine/followers","following_url":"https://api.github.com/users/jberdine/following{/other_user}","gists_url":"https://api.github.com/users/jberdine/gists{/gist_id}","starred_url":"https://api.github.com/users/jberdine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jberdine/subscriptions","organizations_url":"https://api.github.com/users/jberdine/orgs","repos_url":"https://api.github.com/users/jberdine/repos","events_url":"https://api.github.com/users/jberdine/events{/privacy}","received_events_url":"https://api.github.com/users/jberdine/received_events","type":"User","site_admin":false},"created_at":"2018-11-29T10:50:08Z","updated_at":"2018-11-29T10:50:08Z","author_association":"NONE","body":"> For writing portable programs the model where you normalize newlines \n> (and there's a quite a \n> few [more](<http://erratique.ch/software/uutf/doc/Uutf#TYPEnln>)than \n> one might expect) to '\\n' on input and let the underlying stream \n> abstraction convert '\\n' to the platform specific new line convention \n> on output if (and only if) your stream is in text mode is the best way \n> of handling the problem.\n\nI agree, but it would also be useful to have a way to configure the \ntranslation done by the underlying stream if needed (which would default \nto the platform native behavior). For example, it turns out that we \nreceived requests for ocamlformat to produce unix newlines when run on \nwindows, and less strongly, vice versa.\n"}}
{"actor":{"display_login":"jberdine"}}