debugger-agent: fix handling of utf-8