I am trying to create parcel on Sendcloud and I am getting error for street name with special characters: Moalleöandß xejuana n°41 2°4°.Malformed utf-8 characters, possibly incorrectly encoded laravel
GuzzleHttp\Exception\InvalidArgumentException json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded at vendor/guzzlehttp/guzzle/src/Utils.php:299 295▕ public static function jsonEncode($value, int $options = 0, int $depth = 512): string 296▕ { 297▕ $json = \json_encode($value, $options, $depth); 298▕ if (\JSON_ERROR_NONE !== \json_last_error()) { ➜ 299▕ throw new InvalidArgumentException(‘json_encode error: ’.\json_last_error_msg()); 300▕ } 301▕ 302▕ /** @var string */ 303▕ return $json;
I tried something like trim(json_encode($street_name), '"') to get it encoded, but I am not sure will in api it come as good address because I got: Moalle\u00f6and\u00df xejuana n\u00b041 2\u00b04\u00b0
What should I else try? I hope so that someone will be able to help