Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Tickets #9529] Re: json_encode(): Invalid UTF-8 sequence in argument

194 views
Skip to first unread message

bu...@horde.org

unread,
Jan 22, 2011, 12:24:59 PM1/22/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | Jan Schneider <j...@horde.org>
Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | IMP
Version | Git master
Type | Bug
-State | Unconfirmed
+State | Assigned
Priority | 1. Low
Milestone |
Patch |
-Owners |
+Owners | Michael Slusarz
------------------------------------------------------------------------------


Jan Schneider <j...@horde.org> (2011-01-22 12:24) wrote:

Confirmed

--
You are subscribed to this list as: horde...@freebsd.csie.nctu.edu.tw
To unsubscribe, mail: bugs-uns...@lists.horde.org

bu...@horde.org

unread,
Jan 22, 2011, 11:27:31 PM1/22/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529

Updated By | Michael Slusarz <slu...@horde.org>


Summary | json_encode(): Invalid UTF-8 sequence in argument

-Queue | IMP
+Queue | Horde Framework Packages
Type | Bug


State | Assigned
Priority | 1. Low
Milestone |
Patch |

Owners | Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slu...@horde.org> (2011-01-22 23:27) wrote:

I can only partially confirm - I see the error in the browser, but I
don't get any error message in the logs.

Anyway, this is a Horde_Serialize issue, not an IMP issue.

bu...@horde.org

unread,
Jan 22, 2011, 11:27:44 PM1/22/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | Michael Slusarz <slu...@horde.org>
Summary | json_encode(): Invalid UTF-8 sequence in argument

Queue | Horde Framework Packages
-Version |
+Version | Git master


Type | Bug
State | Assigned
Priority | 1. Low
Milestone |
Patch |

-Owners | Michael Slusarz
+Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------

bu...@horde.org

unread,
Jan 24, 2011, 5:20:29 PM1/24/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | Michael Slusarz <slu...@horde.org>
Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages

Version | Git master
Type | Bug
State | Assigned
Priority | 1. Low
Milestone |
Patch |

Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slu...@horde.org> (2011-01-24 17:20) wrote:

>> Anyway, this is a Horde_Serialize issue, not an IMP issue.
>

> I thought this was an IMP issue since the message is displayed using
> traditional view.

It's not displaying correctly because json_encode() is not encoding
the string into valid UTF-8, so the in-browser decoding of the JSON
response is failing. This is why you can view the message fine if
viewing in a popup window - since the message there is loaded directly
in HTML rather than via AJAX/JSON.

bu...@horde.org

unread,
Jan 24, 2011, 5:21:29 PM1/24/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | Michael Slusarz <slu...@horde.org>
Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Assigned
Priority | 1. Low
Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slu...@horde.org> (2011-01-24 17:21) wrote:

> I click once on the message : I get the errors as described when
> creating this ticket. However, I can see the header (From, To,
> Date...) of the message, but not the body.
>
> From there :
> - if I doubled-click on the message, the message shows up just fine
> in the popup window.
> - if I click reply, a reply window appear with the right content.

As mentioned previously, this is because these views are not using JSON data.

bu...@horde.org

unread,
Jan 24, 2011, 7:55:35 PM1/24/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529

Updated By | Git Commit <com...@lists.horde.org>


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Assigned
Priority | 1. Low
Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------


Git Commit <com...@lists.horde.org> (2011-01-24 19:55) wrote:

Changes have been made in Git for this ticket:

Bug #9529: Store description internally as UTF-8, not in charset of part

http://git.horde.org/horde-git/-/commit/929fe1215e12666b847e9fa865320e79bde0a923

bu...@horde.org

unread,
Jan 24, 2011, 7:57:35 PM1/24/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529

Updated By | Michael Slusarz <slu...@horde.org>


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug

-State | Assigned
+State | Resolved
-Priority | 1. Low
+Priority | 2. Medium


Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slu...@horde.org> (2011-01-24 19:57) wrote:

Turns out it was an issue in horde/Mime instead - during the
conversion of Horde code to the assumption that all data is internally
stored in UTF-8, parsing the description field of a MIME header was
not properly converted. It was storing the header internally in the
default charset of the part.

bu...@horde.org

unread,
Jan 25, 2011, 5:08:15 AM1/25/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529

Updated By | Git Commit <com...@lists.horde.org>


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug

State | Resolved


Priority | 2. Medium
Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------


Git Commit <com...@lists.horde.org> (2011-01-25 05:08) wrote:

Changes have been made in Git for this ticket:

Bug #9529: Fix undefined error

http://git.horde.org/horde-git/-/commit/c28f2bd6adf2be0645a80fdd5065e0402b1d7e51

bu...@horde.org

unread,
Jan 25, 2011, 12:04:50 PM1/25/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | Git Commit <com...@lists.horde.org>
Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Resolved
Priority | 2. Medium
Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------


Git Commit <com...@lists.horde.org> (2011-01-25 12:04) wrote:

Changes have been made in Git for this ticket:

Bug #9529: fix decode() call

http://git.horde.org/horde-git/-/commit/fe1959fa39723feee2cb717d1dd422ff9445d1d8

bu...@horde.org

unread,
Jan 25, 2011, 12:05:21 PM1/25/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529

Updated By | Michael Slusarz <slu...@horde.org>


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Resolved
Priority | 2. Medium
Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slu...@horde.org> (2011-01-25 12:05) wrote:

> typo ?

This is why you don't make changes at 2 in the morning :(

bu...@horde.org

unread,
Feb 14, 2011, 12:35:22 PM2/14/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/h/whups/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | rsa...@mbpgroup.com


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Resolved
Priority | 2. Medium
Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz

+New Attachment | lex.eml
------------------------------------------------------------------------------


rsa...@mbpgroup.com (2011-02-14 17:35) wrote:

I ran into an other message with this issue.

it seams that json_encode doesn't like the chars right next to '45000
ORLEANS (FRANCE)'

2011-02-14T18:26:26+01:00 DEBUG: HORDE [imp] PHP ERROR: json_encode():
Invalid UTF-8 sequence in argument [pid 8225 on line 252 of
"/var/www/html/hordetest/libs/Horde/Serialize.php"]
2011-02-14T18:26:26+01:00 DEBUG: 1. Horde::sendHTTPResponse()
/var/www/html/hordetest/services/ajax.php:73
2. Horde::escapeJson() /var/www/html/hordetest/libs/Horde.php:564
3. Horde_Serialize::serialize() /var/www/html/hordetest/libs/Horde.php:606
4. Horde_Serialize::_serialize()
/var/www/html/hordetest/libs/Horde/Serialize.php:67
5. json_encode() /var/www/html/hordetest/libs/Horde/Serialize.php:252
6. Horde::errorHandler()

bu...@horde.org

unread,
Feb 21, 2011, 12:53:18 AM2/21/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://dev.horde.org/h/whups/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | Git Commit <com...@lists.horde.org>


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Resolved
Priority | 2. Medium
Milestone |
Patch |
Owners | Horde Developers, Michael Slusarz

------------------------------------------------------------------------------


Git Commit <com...@lists.horde.org> (2011-02-21 05:53) wrote:

Changes have been made in Git for this ticket:

Bug #9529: On JSON encode error, print error message in preview pane

http://git.horde.org/horde-git/-/commit/9ff07c2c3faa2fe9a77e322c0294d1c38a871897

bu...@horde.org

unread,
Feb 21, 2011, 1:09:20 AM2/21/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/h/whups/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | Michael Slusarz <slu...@horde.org>


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Resolved
Priority | 2. Medium
Milestone |
Patch |

-Owners | Horde Developers, Michael Slusarz
+Owners | Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slu...@horde.org> (2011-02-21 06:09) wrote:

Not much we can do about that message. It is bad UTF-8 and
json_encode() chokes on it.

Unfortunately, json_last_error() doesn't help out because of this
issue: http://bugs.php.net/bug.php?id=54058

However, even in this case if json_last_error() worked properly, it
doesn't solve because forcing a charset conversion to UTF-8 doesn't
work either.

Solution: provide error message in preview pane with link to popup
message (which is loaded via straight HTML so it is not subject to
JSON encoding problems).

bu...@horde.org

unread,
Feb 21, 2011, 3:44:17 AM2/21/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://dev.horde.org/h/whups/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | rsa...@mbpgroup.com


Summary | json_encode(): Invalid UTF-8 sequence in argument
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Resolved
Priority | 2. Medium
Milestone |
Patch |

Owners | Michael Slusarz
------------------------------------------------------------------------------


rsa...@mbpgroup.com (2011-02-21 08:44) wrote:

> Not much we can do about that message. It is bad UTF-8 and
> json_encode() chokes on it.
>
> Unfortunately, json_last_error() doesn't help out because of this
> issue: http://bugs.php.net/bug.php?id=54058
>
> However, even in this case if json_last_error() worked properly, it
> doesn't solve because forcing a charset conversion to UTF-8 doesn't
> work either.
>
> Solution: provide error message in preview pane with link to popup
> message (which is loaded via straight HTML so it is not subject to
> JSON encoding problems).

Thank you for this intermediate solution.

bu...@horde.org

unread,
Apr 4, 2011, 5:52:45 AM4/4/11
to
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9529
------------------------------------------------------------------------------
Ticket | 9529
Updated By | a...@launay.org

0 new messages