N
N
nurdus2018-02-09 00:50:51
MySQL
nurdus, 2018-02-09 00:50:51

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"

Tried after connecting:
db.Query("SET NAMES UTF8")
db.Query("SET CHARACTER SET UTF8")

Did not help. Tell me, pliz, how to treat?! )

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
nurdus, 2018-02-10
@nurdus

The problem was solved by adding "?charset=utf8" to the connection string :)
Thank you all.

A
Alexey, 2018-02-09
@Azperin

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

A
Alexander Sisyukin, 2018-02-09
@Caarl

db.Query("SET NAMES utf8mb4 ")
db.Query("SET CHARACTER SET utf8mb4")
So try

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question