I have a string like "%E6%B1%82%E5%8A%A9".
My question is how i can know it's encoded by "UTF-8" or not. It also seems like GBK(or GB2312) encoding.
Thank you.
I have a string like "%E6%B1%82%E5%8A%A9".
My question is how i can know it's encoded by "UTF-8" or not. It also seems like GBK(or GB2312) encoding.
Thank you.
This is not UTF-8 encoding, it is called Percent or URL Encoding.
You can decode it in Java using URLDecoder API.
There is no way to detect the encoding of a stream of bytes with 100% accuracy, still there are libraries capable of making quite effective educated guesses. Among them I would recommend juniversalchardet.