I'm trying to store data in my database test like "< hi >" is stored as "u003c hi u004e" my database uses utf8mb4 charset. But also I experimented with utf8, utf 32, etc. It didn't work out.
Asked
Active
Viewed 49 times
0
-
change mysql database encoding to utf-8 or 16 follow the link https://www.a2hosting.in/kb/developer-corner/mysql/convert-mysql-database-utf-8 – abhinavsinghvirsen Feb 22 '19 at 09:22
-
or try this link https://stackoverflow.com/a/6115705/7924858 – abhinavsinghvirsen Feb 22 '19 at 09:23
-
I have found a solution. The problem is with gson library while creating json strings. not with the sql db – user3867153 Feb 23 '19 at 10:11
1 Answers
0
The problem is not with the Mysql Db. The problem is with gson/json library.
Use this code to solve it.
Gson gsonBuilder =new GsonBuilder().disableHtmlEscaping().create();

user3867153
- 43
- 6