Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writes use Unix line endings instead of CRLF #1

Open
Vauria opened this issue Jun 19, 2016 · 1 comment
Open

Writes use Unix line endings instead of CRLF #1

Vauria opened this issue Jun 19, 2016 · 1 comment
Labels

Comments

@Vauria
Copy link
Owner

Vauria commented Jun 19, 2016

Not a severe issue, any windows text editor worth it's salt (hell, even wordpad) can handle LF without CR, including the Apropos JSON parser. Consistency would be nice though

@Vauria Vauria added the bug label Jun 19, 2016
@Vauria Vauria self-assigned this Jun 19, 2016
@Vauria
Copy link
Owner Author

Vauria commented Jun 23, 2016

The newline() method in Google's JSON writer class is both private and doesn't use the writer's built in newline() method (which provides platform specific line separators) which is only a little bit infuriating, but the FileWriter it's constructed with is constructed with an OutputStreamWriter which has a public write method I could override and hide a little regex in to replace \n with \r\n

Method in question:
void java.io.OutputStreamWriter.write(String str, int off, int len) throws IOException

The streamwriter it call write on is private though, so I will need to call the supermethod after inserting my carriage return

@Vauria Vauria removed their assignment Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant