API: Add a check for PHP bug 45314 (PHP's WDDX formatter messes up UTF-8) and fix...