Combo connector not loading because of invalid characters

Good day

I am trying to load a combo connector from a database, and a lot of the records have what I am assuming to be invalid characters for the XML result.
What would be the best way to cater for any results that might come from the database instead of str_replacing each character I find?
If the string replace method is my only option, what is the function to change a value using the beforeRender event while loading the connector?

Thank you

PS, I am using the latest connectors from the Github repo, and it is integrated into a CodeIgniter PHP setup

What do you mean by invalid characters ? Can you share some example of invalid XML ?

Connector must escape the XML specific characters automatically.
If you are storing non-utf data in the DB you can configure encoding for connector.

docs.dhtmlx.com/connector__php__ … etencoding

Thank you Stanislav

The set_encoding did the trick…