So you have a CAS server which handles the authentication (IDP) and Elgg is setup to use that (SP), correct?
If so, you need to process the CAS reponse to provide the fields so Elgg can use it. Have a look here https://simplesamlphp.org/docs/stable/simplesamlphp-authproc and in specific https://simplesamlphp.org/docs/stable/core:authproc_attributecopy
Have you created the database to be used for Elgg? You need to do that on your own. And if the database exists, are you sure that the database name, database user and password you have entered are correct? These must match with the database name and the database user must have the permission to access the database. The error message indicates that there's a problem with connecting to the database. But which of the possible reasons I listed for the connection problem I can't tell from the error message as it could be either of them.
Are you using an 2.x Elgg version at all (preferrably latest 2.3)?
What's the encoding set in the browser you use (is it utf8)? If it's not utf8 and especially when copy+paste stuff into the browser from applications maybe also not using utf8 the special characters could get lost before they can even be saved in the database. And if the encoding set in the browser isn't utf8 the special characters might just not get correctly displayed even if they are correctly saved in the database.
What's the encoding of the database / database tables? Is it utf8 or at least an encoding that supports the special characters you need to be supported? If not, the special characters might not get saved correctly in the database. I think Elgg does create the database with utf8 encoding nowadays. But if you are using an older version of Elgg (or have used initially) this might not be the case with your site.
Security issues should be reported to email@example.com!