During the investigation of T266530: 🐛 Bug | Fix Donation List Error in Ops Centre we encountered donations that had non-UTF-8 encoding, causing errors when calling json_encode without JSON_INVALID_UTF8_IGNORE and causing the characters to miss in the display. All the donations have in common that they are coming from PayPal and have no associated tracking code. This means, that someone sent money "directly" to wikimedia from their paypal account, without using the donation form. In those cases, we use the address data that PayPal sends us.
We have several ways to avoid the error:
- Create anonymous donations when someone sends money directly
- Pre-process the input in the controllers, converting the strings to UTF-8 encoding
- Change the Paypal IPN settings to send us UTF-8 encoded data. This StackOverflow answer makes it look like that might be quite involved.
When this bug is fixed, the quickfix for the encoding error - adding JSON_INVALID_UTF8_IGNORE to Backend_AjaxController should be removed.