P
P
Perkovec2014-08-24 13:49:14
Java
Perkovec, 2014-08-24 13:49:14

How to change the encoding of a string?

I have a string, the value of which I get from the JSON file . The "name" object in the JSON file can contain both Latin and Cyrillic, but Cyrillic is displayed as a rhombus with a question. As I understand it, the encoding "cp1251" is used, but "UTF-8" is needed. How to change encoding? PS Android development.
final String transname=jsonObj.getString("name");

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Moxa, 2014-08-24
@Moxa

feed the json parser a string in the desired encoding

B
balza, 2014-09-03
@balza

docs.oracle.com/javase/6/docs/api/java/lang/String...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question