How to put chinese character in the Manifest file
Hi,
I want to know that how can we put chinese characters in the manifest file. Please suggest a solution.
Regards
Hi,
I want to know that how can we put chinese characters in the manifest file. Please suggest a solution.
Regards
Although the specification doesn't mention it explictely ( http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest), things seem to point to the fact, that the MANIFEST.MF is encoded in UTF-8. So just save your file in UTF-8 encoding, and it should just work.
Use this
String src = "Chinese Text";
byte[] utf8SrcBytes = src.getBytes("UTF8");
String utf8SrcString = new String (src.getBytes("UTF8"), 0, utf8SrcBytes.length, "UTF8");
convert first string into bytearray of UTF8 format
and again that array into string
This will work
> [slightly confused stuff removed]
Sorry, AmitChalwade123456, I know trolling can be very funny, but you're confusing the sh*t out of newbies with this almost-seems-usefull kind of talk.
Stop that.
And in case you really meant that seriously: Please refrain from giving advice with regard to encoding. What you posted is wrong (to put it mildly).
> This will work
In the sense that it will make an exact copy of a string, yes. But it's pointless and obscure, so it would be just stupid to actually use it especially since it does exactly nothing.