I 'm using following data to decode the UTF-8 encoded String.In Android, How to decode UTF-8 encoded String?
-
Actual string: 秦世俊:用「心」工作 找到屬於自己的成就感【開講啦 20160430】T
-
UTF-8 encoded: 秦ä¸ä¿ï¼ç¨âå¿âå·¥ä½ æ¾å°å±äºèªå·±çæå°±æãå¼è®²å¦ 20160430ã"
. Output is same as input. What is the issue?
Method:
public String decodeString(String encodedString) {
return new String(encodedString.getBytes(), "UTF-8");
}
I don't think your 'encodedString' is utf8 encoded – Gohan
It is. You can decode it here: https://mothereff.in/utf-8 , and result would be fine. –
Please post more code so it is reproducable for us. It's pretty unclear what you are doing now. For instance you should start with a string initialized and then 'String encodedString = .....;' and so on. – greenapps