[Tickets #14490] Re: serialization failed

noreply at bugs.horde.org noreply at bugs.horde.org
Tue Oct 18 12:48:48 UTC 2016


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: https://bugs.horde.org/ticket/14490
------------------------------------------------------------------------------
  Ticket           | 14490
  Aktualisiert Von | marth at tsvschlieben.de
  Zusammenfassung  | serialization failed
  Warteschlange    | IMP
  Version          | 6.2.16
  Typ              | Bug
  Status           | Unconfirmed
  Priorität        | 3. High
  Milestone        |
  Patch            |
  Zuständige       |
------------------------------------------------------------------------------


marth at tsvschlieben.de (2016-10-18 12:48) hat geschrieben:

The following code solved the issue for me

             $tmp = json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR);

             /* Basic error handling attempts.
              * TODO: JSON_ERROR_UTF8 = 5; available as of PHP 5.3.3 */
             if (json_last_error() === 5) {
                 $data =  
json_encode(Horde_String::convertCharset($data, $params, 'UTF-8',  
true), JSON_PARTIAL_OUTPUT_ON_ERROR);
             } else {
                 $data = $tmp;
             }

This option is available since PHP5.5

Maybe one of the developers could take a look if this a valid  
workaround or bullshit...





More information about the bugs mailing list