I have some code (at django server) that writes json data contained in POST requests into mysql db. Some requests contain specific pictograms like or . Those are supposed to be written to a text field, but cause a db error.
Code processing the requests looks like
json_data = json.loads(request.body.decode('utf-8'))
i = Event(event=json_data['event'], dt=parse(json_data['dt']),
object_id=json_data['object_id'], user_id=json_data['user_id'],
payload=json_data['payload'])
i.save()
db collation is currently set to uft8_general_ci.
Error returned is 'Incorrect string value'.
What is best practice to have such requests saved to the db along others?
update: By changing collation to utf8mb4_general_ci I can now write those symbols to db directly (via phpmyadmin) but still no luck with python request. Same error. Something on django side?