I have a MariaDB database containing key signatures from pieces of music - letter plus sharp or flat as in E♭, F♯, etc. My database tool (DBForge Studio) displays these just fine, and tells me that the collation is ‘utf8mb3_general_ci’. Exporting the database to a CSV and opening it in Excel shows ♭ and ♯ as expected. Excel’s UNICODE function shows 9837 for ♭ and 9839 for ♯.
I’m using the MySQLCommunityServer connector to connect to the DB, and what I assume is the ‘standard’ method of db.selectSQL into a rowset, then stepping through each row, assigning the fields to a temporary string variable, then listbox(name).addrow to populate an on-screen list box.
When I do this, both ♭ and ♯ come out as ?
What should I be checking next? Suggestions on how to get Xojo to display these characters correctly in a list box are welcome!
Check in the Xojo debugger to see if your temporary string variable has a UTF-8 encoding.
If it is not UTF-8 then there is possibly a bug in the Xojo plugin and you may have to use DefineEncoding to tell Xojo the string does contain UTF-8 characters.
AFAIK, if you don’t tell Xojo which encoding the RowSet/RecordSet is using, it will pull VarChar/Text/etc… with a NIL encoding.
BTW: You should ALWAYS define the encoding of Strings while reading from a 3rd party Database. SQlite might be an exception and automatically use UTF8?