Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9486

Re: json decode issue

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'mrab': 0.05; 'json': 0.07; 'received:verizon.net': 0.07; 'subject:issue': 0.07; 'terry': 0.07; 'backslash': 0.09; 'correct.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'valueerror:': 0.09; 'output': 0.11; 'wrote:': 0.15; '"...': 0.16; 'reedy': 0.16; 'pm,': 0.16; 'jan': 0.19; 'java': 0.21; 'this?': 0.22; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'invalid': 0.25; '(or': 0.25; 'string': 0.26; "i'm": 0.27; 'correct': 0.29; 'problem': 0.29; 'fix': 0.29; 'to:addr:python-list': 0.34; 'header:X-Complaints-To:1': 0.34; 'header:User-Agent:1': 0.34; 'be.': 0.34; 'skip:" 10': 0.36; 'some': 0.37; 'received:org': 0.38; 'not,': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'header:Mime-Version:1': 0.39; 'either': 0.39; 'to:addr:python.org': 0.39; 'delete': 0.40; 'double': 0.62; 'greetings,': 0.66; 'cause': 0.69
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: json decode issue
Date Thu, 14 Jul 2011 16:03:03 -0400
References <87ac9918-c05c-482e-9789-ee90b1e9eb80@glegroupsg2000goo.googlegroups.com> <4E1F4174.1070408@mrabarnett.plus.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding quoted-printable
X-Gmane-NNTP-Posting-Host pool-74-109-121-73.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11
In-Reply-To <4E1F4174.1070408@mrabarnett.plus.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1036.1310673800.1164.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1310673800 news.xs4all.nl 23906 [2001:888:2000:d::a6]:51714
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:9486

Show key headers only | View raw


On 7/14/2011 3:20 PM, MRAB wrote:
> On 14/07/2011 18:22, Miki Tebeka wrote:
>> Greetings,
>>
>> I'm trying to decode JSON output of a Java program (jackson) and
>> having some issues.
>> The cause of the problem is the following snippet:
>> {
>> "description": "... lives\uMOVEā„¢ OFFERS ",
>> }
>> Which causes ValueError: Invalid \uXXXX escape.
>>
>> Any ideas on how to fix this?
>>
> Is that valid JSON? If not, you'll either need to fix the program which
> generated it (or report it as a bug), or pre-process the JSON to
> correct the error, if you know what it should be.

If you delete or double the backslash in that one particular spot, the 
string will parse, even if it is not correct.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

json decode issue Miki Tebeka <miki.tebeka@gmail.com> - 2011-07-14 10:22 -0700
  Re: json decode issue MRAB <python@mrabarnett.plus.com> - 2011-07-14 20:20 +0100
  Re: json decode issue Terry Reedy <tjreedy@udel.edu> - 2011-07-14 16:03 -0400
  Re: json decode issue Nobody <nobody@nowhere.com> - 2011-07-15 06:10 +0100

csiph-web