List first letter of categories – issue upon spcecial characters (danish letters)

Use the Multibyte String functions, in this case mb_strtoupper().

This is a general rule: in WordPress, output is usually encoded in UTF-8. Avoid single-byte functions like strlen(), substr() and others when there is a better mb_* function.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)