Add encoding support to create_db