Repository navigation
Commit 9620991
committed
Refuse a Java file that is not UTF-8 instead of rewriting it
new String(bytes, UTF_8) turned each byte that is not UTF-8 into
U+FFFD, and --replace wrote the result back: an "é" saved as Latin-1
became EF BF BD, and the exit code was 0. Files.readString throws on
such a byte, so the file is reported as one Main could not read and
stays as it is, with exit code 2.
Standard input still decodes with replacement.1 parent dbd0dd7 commit 9620991
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
0 commit comments