better support for database encoding