cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
The decode fails on the first try with "Wide character in subroutine entry at readtweets.pl line 15, <IN> line 1." Here is the string it is choking on. The error doesn't say which char is the problem. I don't see anything amiss in the string. If I save it as example.json it opens in Firefox with no parsing errors. How to debug this?use feature ':5.10'; use JSON::XS; my $path = 'C:\Downloads'; $path =~ s/\\/\//g; my $fn = 'twitter_raw.json'; open(IN,"< :encoding(UTF-8)", "$path/$fn") or die "Can't open input: $ +!\n"; while(<IN>) { chop; my $j = decode_json($_); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: JSON::XS Wide Character Problem
by 1nickt (Canon) on Jun 04, 2022 at 11:14 UTC | |
by cormanaz (Deacon) on Jun 04, 2022 at 22:24 UTC | |
|
Re: JSON::XS Wide Character Problem
by graff (Chancellor) on Jun 04, 2022 at 00:05 UTC | |
by cormanaz (Deacon) on Jun 04, 2022 at 18:02 UTC | |
by graff (Chancellor) on Jun 04, 2022 at 20:41 UTC | |
by Anonymous Monk on Jun 04, 2022 at 19:53 UTC | |
by LanX (Saint) on Jun 04, 2022 at 21:02 UTC | |
by LanX (Saint) on Jun 04, 2022 at 21:15 UTC |