use utf8, convert switch->if, correct error msg for ParseSrvURL