couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Broerse <martin.broe...@gmail.com>
Subject Re: exporting text to JSON hangs on %27 character
Date Sat, 06 Mar 2021 22:10:56 GMT
Hi Bill,

In JSON the single quote is no problem. See
https://my.cloudstation.com/bloggr/post_2_FA2873BC-66FA-5689-9D26-117DF25A6AC6

- Martin

On Sat, 6 Mar 2021 at 21:45, Bill Stephenson <bill@cherrypc.com.invalid>
wrote:

> I’m using Perl to convert old CGI.pm “save” files to JSON that look like
> this:
>
> c_name=Joseph%20Semeister
> c_address1=9445%20Sofa%27s%20Mill%20Rd
> c_address2=
> c_city=Red%20Tree
> c_state=PA
> c_zip=17356
> =
>
> and loading them into a CouchDB (v. 3.1.1) with curl but files with that "
> %27 “ string hang with an error:
>
> malformed JSON string, neither tag, array, object, number, string or atom,
> at character offset 0 (before "(end of string)")
>
> I’ve narrowed down the issue to that “%27” and I can remove that like so:
>
>         $myJSON =~ s/'//;
>
> But that doesn’t preserve the original text string "9445 Sofa’s Mill Rd”.
>
> I’m not savvy enough to call this a “bug” but this doesn’t break on other
> encoded text like “%20”.
>
> Anyone got any suggestions for how I might work around this?
>
> --
>
> Kindest Regards,
>
> Bill Stephenson
>
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message