Answer the question
In order to leave comments, you need to log in
Why does mysql return \ufffd \ufffd?
Good evening.
RestAPI in golang returns json like this:
"Title": "\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd"
db.Query("SET NAMES UTF8")
db.Query("SET CHARACTER SET UTF8")
Answer the question
In order to leave comments, you need to log in
The problem was solved by adding "?charset=utf8" to the connection string :)
Thank you all.
Isn't this the standard for escaping characters when passing json? Try to serialize and then throw in a string, and on the site already parse as json
db.Query("SET NAMES utf8mb4 ")
db.Query("SET CHARACTER SET utf8mb4")
So try
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question