I have a MySQL table where the username field is a latin1 charset. If I search this table with a UTF8 string, I get this error:
Error: ER_CANT_AGGREGATE_2COLLATIONS: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_unicode_ci,COERCIBLE) for operation 'like'
Side question: is this because I'm using the LIKE statement, specifically?
I feel like the only solution to my problem is to check if the username parameter from the HTTP query is a latin1 compatible string or not. If it is not, then omit it from the SQL query.
How could I check if a particular string is compatible with a specific character set like latin1 in JavaScript/Node.js?