replace bad chars in sql output