Fix bert encoding when not using websockets

Was a UTF8 encoding issue with strings.