Android string encoding and html entities converting

后端 未结 2 1753
青春惊慌失措
青春惊慌失措 2021-01-17 11:46

There is a String in Android Java. How do I change it to another given encoding and replace HTML-entities such as & with &?

Thi

2条回答
  •  执笔经年
    2021-01-17 12:07

    You can add denpendency:

    implementation group: 'org.apache.commons', name: 'commons-text', version: '1.3'
    

    And use StringEscapeUtils.unescapeHtml4(s), then get the result.

提交回复
热议问题