Convio API Encoding Error

Options

In using PHP to retrieve a C360 record via the Constituent API, we are seeing an occasional error with the following bit of PHP code:

// access API & retrieve content into $buffer

...

// Parse data

try {

$xmlE = @new SimpleXMLEelement($buffer);

} catch(Exception $e) {

print 'Parsing of buffer failed';

}

The problem has been tracked down to a constituent's name containing a diacritical. PHP's SimpleXML functions expects the XML provided to be in UTF-8, which apparently is not the case with Convio's API. We have managed to work around this by forcing an encoding.

Tagged:

Comments

  • And that's probably about all you can do. Thanks for the tip, definitely useful to me.

Categories