fix encoding to match go encoding