ENCODING ENCODING ENCODING ....
Various input sources can cause String encoding complications. for example, there may be UTF-8 encoding, and the other - ISO
some people have suggested that the code works for them, so it is most likely that your lines have different encodings during processing. (different coding results in different byte arrays are thus not replaced ...)
To solve your problem from its root, you must make sure that each of your sources uses exactly the same encoding.
try this exercise and it will hopefully help you solve your problem:
1 try the following:
System.out.println(Arrays.asList("Ä".getBytes()); //1 and 2 should have same results System.out.println(Arrays.asList(new String("Ä","UTF-8").getBytes()); //1 and 2 should have same results System.out.println(Arrays.asList(new String("Ä","UTF-32").getBytes()); //should have a different results from one and two System.out.println(Arrays.asList(orig.getBytes()); //look for representation and search for pattenr of numbers (this bit is the hard bit I guess). System.out.println(Arrays.asList(new String(orig,"UTF-32").getBytes()); //look for representation and search for pattenr of numbers (this bit is the hard bit I guess).
the next step is to see how the orgi string is orgi . for example, if you received from the Internet, make sure your POST and GET method uses your preferred encoding
EDIT 1:
try the following:
{ { new String("Ä".getBytes(),"UTF-8"), "Ae" }, ... };
if this does not work, try this:
byte[] bytes = {-61,-124}; //byte representation of Ä in utf-8 String Ae = new String(bytes,"UTF-8"); { { Ae, "Ae" }, ... }; //and do for the rest
nafas
source share