Hello!
I use DB to store bot data. Today I saw this in conversation table:

English letters stores fine, but other looks like: \u0417\u0430. In telegram client all looks good...
In message table letters shows fine.
Is this a problem?
json encodes special characters into this format
But it shouldn't do that for normal letters...
It's normal letters (Russian language), not the special chars.
Russian characters are not normal characters when it comes to encoding.
In message table they are looks correct.
Fields in message table are not being json encoded, they are using database/table encoding, which usually supports cyrillic.
Json converts all UTF8 characters into escaped unicode characters. It prefers to operate on standard characters a-Z, 0-9, and basic symbols.
What is the problem anyway? When you get state data back using Conversation characters should be as they were typed.
What is the problem anyway?
Uncomfortable to watch string conversation values in the database.
Also I want to understand how it works.
@Sogl
To find out more about JSON and how it handles different data types, check here:
http://json.org/
closing here...
Most helpful comment
Fields in
messagetable are not being json encoded, they are using database/table encoding, which usually supports cyrillic.Json converts all UTF8 characters into escaped unicode characters. It prefers to operate on standard characters a-Z, 0-9, and basic symbols.
What is the problem anyway? When you get state data back using Conversation characters should be as they were typed.