I am using kotlin with mysql. I have a string stor...
# announcements
s
I am using kotlin with mysql. I have a string stored in mysql DB as : Apple's . However when I hit the rest api to read the string, it is displayed in logs as Apple \u2019. Why do my logs display the unicode character? Also on terminal, i see it as \u2019.
b
Check character encoding in MySQL, input channels, and output channels, as well as escaping settings
Good place to start is to ensure everything is UTF-8 instead of US-ASCII or ISO-8859-1 or ...
s
When i read same string on mysql client. Its displayed as Apple's
j
Your terminal locale may not be set to utf8.
s
@James Richardson my terminal locale is set to utf8
w
Wait you see that in a rest api? Do you mean thats what you see in a browser when you hit the rest endpoint. Or the problem is only when you log the response? or something else?
s
@Wesley Acheson actually the rest api invokes db. And data retrieved from db is passed to third party api. I see the 3rd party api fails because unicode(\u2019) is passed. We log the data that is passed to third party api. And i see it is logged as \u2019.
w
In that case your problem isn't in the logging its either in the rest endpoint or in the code thats consuming from the rest endpoint. For the record you'd probably be better off with ' rather than ’ as that charachter is more widely supported, but that probably doesn't help you.