Creating BufferedReader from Files.newBufferedReader
Files.newBufferedReader(Paths.get("a.txt"), StandardCharsets.UTF_8);
when running the application it may throw the following exception:
java.nio.charset.MalformedInputException: Input length = 1
But
new BufferedReader(new InputStreamReader(new FileInputStream("a.txt"),"utf-8"));
works well.
The different is that, the former uses CharsetDecoder default action.
The default action for malformed-input and unmappable-character errors is to report them.
while the latter uses the REPLACE action.
cs.newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE)
There are two ways to specify how GET parameters are interpreted:
Set the URIEncoding attribute on the <Connector> element in server.xml to something specific (e.g. URIEncoding="UTF-8").
Set the useBodyEncodingForURI attribute on the <Connector> element in server.xml to true. This will cause the Connector to use the request body's encoding for GET parameters.
N. Krasnogor, and J. Smith. Proceedings of the Genetic and Evolutionary Computation Conference (GECCO-2000), page 987--994. Morgan Kaufmann, San Francisco, (2000)
N. Krasnogor, and J. Smith. Proceedings of the Genetic and Evolutionary Computation Conference (GECCO-2000), page 987--994. Las Vegas, Nevada, USA, Morgan Kaufmann, (10-12 2000)
G. Harik, and F. Lobo. In W. Banzhaf et al., editors, Proceedings of the Genetic and Evolutionary Computation Conference GECCO-99, San Francisco, CA. Morgan Kaufmann, page 258-265. (1999)
J. Schaffer, R. Caruana, L. Eshelman, and R. Das. Proceedings of the third international conference on Genetic algorithms, page 51--60. San Francisco, CA, USA, Morgan Kaufmann Publishers Inc., (1989)