sockutils: fix an undefined variable, an unused variable, add an encoding line, and some minor formatting changes
sockutils: fix an undefined variable, an unused variable, add an encoding line, and some minor formatting changes

doublereedkurt/boltons,suranap/boltons,zeroSteiner/boltons,kevinastone/boltons,neuropil/boltons,siemens/boltons,markrwilliams/boltons