Character Encoding issue
FanJups opened this issue · 2 comments
While working on PR #237 to solve #217 , I used this symbol "©" inside my html input file but one test failed because of this character then I started thinking about a way to solve that issue.
We should find a way to add encoding utf8 to the InputStream at the core level not when doing tests. Now, we add encoding when doing tests, we should correct that.
https://stackoverflow.com/questions/5928046/spring-mvc-utf-8-encoding
https://stackoverflow.com/questions/5649329/utf-8-encoding-problem-in-spring-mvc
https://stackoverflow.com/questions/29434896/how-to-deal-with-java-encoding-problems-especially-xml
https://www.baeldung.com/java-char-encoding
DOES "multipart/form-data handle utf8 encoding ?
https://issues.redhat.com/browse/RESTEASY-390
java define encoding of InputStream
https://stackoverflow.com/questions/3043710/java-inputstream-encoding-charset
set the charset of bytes java
//Convert from String to byte[]:
String s = "some text here";
byte[] b = s.getBytes(StandardCharsets.UTF_8);
//Convert from byte[] to String:
byte[] b = {(byte) 99, (byte)97, (byte)116};
String s = new String(b, StandardCharsets.US_ASCII);
This issue is also related to non ascii characters:
https://www.baeldung.com/java-char-encoding
https://stackoverflow.com/questions/41690641/non-ascii-value-symbols-not-getting-printed
https://docs.oracle.com/javase/8/docs/api/java/text/Normalizer.html
https://www.tabnine.com/code/java/classes/java.text.Normalizer
https://www.educative.io/answers/what-is-stringutilsisasciiprintable-in-java
https://stackoverflow.com/questions/30111273/how-do-i-remove-copyright-and-other-non-ascii-characters-from-my-java-string
https://github.com/google/guava/wiki/StringsExplained
https://stackoverflow.com/questions/54752377/handling-strings-with-special-characters-in-java