I import character strings from JSON files to temporary SAS tables (SAS 9.4M7) and then write them to a permanent MySQL table (MySQL Community Server on Linux, 8.0.12). The SAS tables are set as UTF-8, the MySQL table has "utf8_general_ci" as table collation (same on column level for the relevant columns). The import to SAS works without any problems. However when I execute the SAS code that writes to the MySQL table certain lines result in an error: "Execute error: Invalid utf8 character string:"
The character that seems to cause this error is displayed as the replacement character in SAS (black rhombus with question mark). One instance is a euro sign (€) which is encoded as "\u20ac*" in the JSON file. The root cause might be located at the data source; however I require the interface from SAS to MySQL to be reliable, i. e. everything that is successfully read into SAS must also be written to MySQL without errors. So the question is: why does SAS accept a certain set of characters while in UTF-8 but MySQL doesn't?
EDIT: The SAS session also runs in UTF-8 as verified by PROC OPTIONS. One character that seems to cause the problem is this one: https://www.fileformat.info/info/unicode/char/100004/index.htm