Checks java file encoding on windows (PR #75)#76
Open
ab3dat wants to merge 2 commits intoSerCeMan:masterfrom
Open
Checks java file encoding on windows (PR #75)#76ab3dat wants to merge 2 commits intoSerCeMan:masterfrom
ab3dat wants to merge 2 commits intoSerCeMan:masterfrom
Conversation
This implementation checks whether the UTF-8 file encoding is set when working on windows. If the wrong file encoding is set mounting the drive works, but accessing and working on it doesn't work. Details see pull request SerCeMan#75
SerCeMan
reviewed
Jul 9, 2019
| String winFspPath = WinPathUtils.getWinFspPath(); | ||
| if (!System.getProperty("file.encoding").equals("UTF-8")) | ||
| { | ||
| System.out.println("UTF-8 encoding required! Current encoding: " + System.getProperty("file.encoding")); |
Owner
There was a problem hiding this comment.
I'm not sure if it's a good idea to print such errors into stdout. That way, we might mess with the stdout of an application which other apps might rely upon.
Author
There was a problem hiding this comment.
changed it to
if (!System.getProperty("file.encoding").equals("UTF-8"))
{
throw new FuseException("UTF-8 encoding required! Current encoding: " + System.getProperty("file.encoding"));
}
Guess that's the better solution. It stops immediately.
Not sure right now, do I have to close this PR and open a new one or are you able to access the new version?
SerCeMan
reviewed
Jul 9, 2019
Owner
SerCeMan
left a comment
There was a problem hiding this comment.
Hi, @ab3dat! Thank you for your contribution! I don't think we should print the warning to stdout. I need to check whether jnr already uses any loggers. If not, maybe a runtime error would be a reasonable response since it's not going to work anyways.
Replace output to stdout and throw exception if file encoding is not UTF-8 if running on Windows Details see pull request SerCeMan#75
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implementation checks whether the UTF-8 file encoding is set when working on windows. If the wrong file encoding is set mounting the drive works, but accessing and working on it doesn't work.
Details see pull request #75