[DB] fixed some encoding problem and removed those dirty sqlize functions