I have a MySQL database which was created as utf8mb4 (with collation utf8mb4_collate_ci) which I'm accessing via some JSP pages. The JSP pages are all stored as UTF-8, and all include the following tags:
<%@ page contentType="text/html; charset=utf-8" %>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
Using MySQL Workbench, I can store non-ASCII text in the DB and display it, and in the JSP pages, I can display the stored text correctly. However, when I try to insert new rows containing non-ASCII text from a JSP page they end up being stored as "??????" in the database (and displayed as such whether selected from JSP or from MySQL Workbench). If I display the text I'm inserting as part of the JSP page, it displays correctly in my browser.
The only thing I can think of is that the JSP-to-MySQL network connection somehow uses the wrong encoding, but I'm totally baffled how or why.
Any advice welcomed!