[FIX] fields.function: make sure all binary values can always be serialized as valid XML
[FIX] fields.function: make sure all binary values can always be serialized as valid XML

Nnormally, binary fields should be 7-bit ASCII base64-encoded data, but sometimes
it's not the case, so we do additional sanity checks to make sure the binary values
can pass safely via xmlrpc as strings.

As a last resort we coerce the binary values to unicode to make sure they can
be safely serialized as utf-8-encoded values, always valid XML characters.
When this happens, decoding on the other endpoint is not likely to produce
the expected output, but this isjust a safety mechanism(in these cases base64
data or xmlrpc. Binary values should be returned instead by the function field.

In a future version we should probably switch to using XMLRPC Binary types always for
passing fields.binary values, but this requires more refactoring.

MarkusTeufelberger/openobject-server,ovnicraft/openerp-server,gisce/openobject-server,vnc-biz/openerp-server,splbio/openobject-server,MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server,splbio/openobject-server,splbio/openobject-server,vnc-biz/openerp-server,gisce/openobject-server,gisce/openobject-server,ovnicraft/openerp-server