How to correctly reference charset = utf8

I have my coding in my php code in the PDO connection, it works correctly, but when you insert the data into MySQL, you can see it; (Ñ) Send them in lowercase CASTAñEDA example, in my form in most of the fields, I have what is $ strtoupper but I put all in lowercase and all converted to uppercase minus the tildes that I mention, I know that it is the case, some people say that they do not go with an accent but for example I put a character like this -> (Á, Ó) and similarly converts them into the base in (á, ó) example (Song) I do not know what my error is I'm investigating about $ mb_strtoupper but I really need an example in coding.