Reputation: 23
String is stored in database as unicode "\u0435\u043e ..." (table's encoding is UTF-8).
After selecting from database and printing:
log.Println(str)
OUT: \u0435\u043e...
How can I transform this string to utf presentation?
Upvotes: 0
Views: 134
Reputation: 49157
To decode the string you have, you can do:
import "net/url"
...
url.QueryUnescape("\u0435\u043e")
But I think there's a misconfiguration of your database or connection parameters, as this should be handled automatically. This is not utf-8 BTW.
Upvotes: 2