escape | in plugin output response

I added management for escaping | character in plugin_output response.
We have a plugin that returns a string into perf_data. But this string can sometimes contain a |. We have tried to not modify shinken by writing perf_data on several lines like

[text]|\n|[perf_data with |]

It works into shinken but livestatus doesn't provide the perf_data at all (empty).
So the only choice we have is to provide a patch for escaping | preceded by \