Forums / Bug Reports / PayPal Express Checkout: Invalid multi-byte characters for non-UTF-8 sites

PayPal Express Checkout: Invalid multi-byte characters for non-UTF-8 sites

Views: 830

Results 1 to 1 of 1
13 Jan 2015, 8:59 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

PayPal Express Checkout: Invalid multi-byte characters for non-UTF-8 sites

If a site is running with a CHARSET value set to something other than 'UTF-8' and the customer's shipping address includes non-standard ASCII characters (such as ¡¿ñúóíéá) then the customer's order-record is sprinkled with invalid characters. For example, if the customer's name is TéST CUSTOMER ¡DO NOT DISPATCH!, this is recorded as TéST CUSTOMER.

The root of the issue is that the PayPal interface, per its documentation (https://developer.paypal.com/docs/classic/api/NVPAPIOverview/) is *assumed *to be UTF-8. As such, the non-standard ASCII gets muddled going up in the request and further muddled when its decoded coming down in the response.

I've seen the issue on PayPal Express Checkout as far back as v1.3.9f and assume that the issue will also assert itself on the other PayPal payment methods when used on a non-UTF-8-encoded site.