Fix capture for python3 (adds assumption that socket data is in utf-8)