You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title suggests, I am working on a database table in MySQL that contains varchar fields. But strangely, the original program used Latin1 encoding to store the table in the database. When I use the entity generated by sea orm for querying, the query result string will display garbled characters. Can the garbled code problem be directly solved through configuration, or do we need to manually convert it in the code after querying the database using other methods? Using Unicode=true&charcterEncoding=latin1 parameter, and executing "SET NAMES latin1" before executing native SQL to obtain query results, then manually converting the string encoding can solve the problem.
I always find a good solution to this problem when using Java language, but for Rust language, I am still a novice. If someone who can solve this problem can also ask and teach me, thank you very much
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As the title suggests, I am working on a database table in MySQL that contains varchar fields. But strangely, the original program used Latin1 encoding to store the table in the database. When I use the entity generated by sea orm for querying, the query result string will display garbled characters. Can the garbled code problem be directly solved through configuration, or do we need to manually convert it in the code after querying the database using other methods? Using Unicode=true&charcterEncoding=latin1 parameter, and executing "SET NAMES latin1" before executing native SQL to obtain query results, then manually converting the string encoding can solve the problem.
This is a Java code example:
I always find a good solution to this problem when using Java language, but for Rust language, I am still a novice. If someone who can solve this problem can also ask and teach me, thank you very much
Beta Was this translation helpful? Give feedback.
All reactions