01mf02 / jaq

A jq clone focussed on correctness, speed, and simplicity
MIT License
2.61k stars 63 forks source link

Bug using | more #183

Closed hellishvictor closed 4 weeks ago

hellishvictor commented 1 month ago

Hi, here on Win 7 x64 using | more on: curl -s https://theunitedstates.io/congress-legislators/legislators-current.json | jaq.exe --color=never .[] | more

it shows:

?┼?=>?┼┼????=>?????
┼????????:?┼┼????????┼???????????┼???????>???????┼??????>????┼???>?┼┼┼??????
┼┼??????
┼??┼┼????????┼?????=>?????????┼????????>???┼┼????????????????┼┼?????>???┼????>????┼????????????┼┼???
?????=>???????
??┼??=>?┼┼????????=?┼┼???>?????┼????????>????????┼?????>?┼┼?????>???????┼┼????>??┼?
????>?┼┼?┼┼┼??=>????┼┼????>???????┼┼┼???????????┼┼???=>?~?┼┼┼?????>??┼┼┼??????????┼┼?
┼?
┼┼????????┼┼┼????????????┼┼??=>???????┼┼┼???????
┼┼?????????┼┼????>??????┼??┼┼?┼┼┼??=>????┼┼????>???????┼┼┼???????????┼┼???=>?~?┼┼┼?????>??┼┼┼???????
???┼┼??┼??┼┼????????┼┼┼???????????
┼┼??=>???????┼┼┼????????┼┼?????????┼┼????>??????┼??┼┼?┼┼┼??=>???
┼┼????>???????┼┼┼???????????┼┼???=>?~?┼┼┼?????>??┼┼┼??????????┼┼?
┼?
┼┼????????┼┼┼????????????┼┼??=>???????┼┼┼???????
┼┼?????????┼┼????>??????┼┼┼??????????????????????┼??┼┼?┼┼┼??=>????┼┼????>???????┼┼┼???????????┼┼???=
>?~?┼┼┼?????>??┼┼┼??????????
┼┼???>??????????????????┼┼??┼??┼┼????????┼┼┼????????????┼┼??=>???????┼┼┼????????┼┼????>?
┼┼????>??????┼┼┼??????????????????┼┼?????>????????????????????????????┼┼???=>????????┼┼┼???????????
┼┼????????????????????????????
┼┼???????????????????????┼??┼┼?┼┼┼??=>???
┼┼????>???????┼┼┼???????????┼┼???=>?~?┼┼┼??????????
┼┼????>??┼┼???>????????????????┼┼┼?????????????????????????????????┼┼┼????????????
┼┼???>????????┼┼┼???????>????????????????????┼┼┼???=>????4?????????????┼┼????????????
-- Más  --

Cheers.

01mf02 commented 1 month ago

This is very strange. On Linux, I cannot reproduce this problem. What does curl -s https://theunitedstates.io/congress-legislators/legislators-current.json | more give you?

hellishvictor commented 1 month ago
[
  {
    "id": {
      "bioguide": "B000944",
      "thomas": "00136",
      "lis": "S307",
      "govtrack": 400050,
      "opensecrets": "N00003535",
      "votesmart": 27018,
      "fec": [
        "H2OH13033",
        "S6OH00163"
      ],
      "cspan": 5051,
      "wikipedia": "Sherrod Brown",
      "house_history": 9996,
      "ballotpedia": "Sherrod Brown",
      "maplight": 168,
      "icpsr": 29389,
      "wikidata": "Q381880",
      "google_entity_id": "kg:/m/034s80"
    },
    "name": {
      "first": "Sherrod",
-- Más  --
01mf02 commented 1 month ago

Ok. Can you tell me the output of the following commands?

curl -s https://theunitedstates.io/congress-legislators/legislators-current.json > legislators-current.json
jaq.exe --color=never .[] legislators-current.json | more

And:

type legislators-current.json | jaq.exe --color=never .[] | more

And:

type legislators-current.json | jaq.exe --color=never .[]
hellishvictor commented 1 month ago

The first two output the same wrong data that is on the first comment; I just switched to jaq for get more speed, but not problem at all when using jq, dasel, or any other. For examples:

curl -s http://programminghistorian.org/assets/jq_rkm.json | jq.exe .[] | more

48
359
[
  {
    "links": {
      "self": "https://www.rijksmuseum.nl/api/nl/collection/SK-C-5",
      "web": "https://www.rijksmuseum.nl/nl/collectie/SK-C-5"
    },
    "id": "nl-SK-C-5",
    "objectNumber": "SK-C-5",
    "title": "Schutters van wijk II onder leiding van kapitein Frans Banninck Cocq, bekend als de ÔÇ
ÿNachtwachtÔÇÖ",
    "hasImage": true,
    "principalOrFirstMaker": "Rembrandt Harmensz. van Rijn",
    "longTitle": "Schutters van wijk II onder leiding van kapitein Frans Banninck Cocq, bekend als d
e ÔÇÿNachtwachtÔÇÖ, Rembrandt Harmensz. van Rijn, 1642",
    "showImage": true,
    "permitDownload": true,
    "webImage": {
      "guid": "3ae88fe0-021c-41ae-a4ce-cc70b7bc6295",
      "offsetPercentageX": 50,
      "offsetPercentageY": 100,
      "width": 2500,
      "height": 2034,
-- Más  --

curl -s http://programminghistorian.org/assets/jq_rkm.json | dasel -r json -w yaml | more

elapsedMilliseconds: 48
count: 359
artObjects:
  - links:
      self: https://www.rijksmuseum.nl/api/nl/collection/SK-C-5
      web: https://www.rijksmuseum.nl/nl/collectie/SK-C-5
    id: nl-SK-C-5
    objectNumber: SK-C-5
    title: Schutters van wijk II onder leiding van kapitein Frans Banninck Cocq, bekend als de ÔÇÿNa
chtwachtÔÇÖ
    hasImage: true
    principalOrFirstMaker: Rembrandt Harmensz. van Rijn
    longTitle: Schutters van wijk II onder leiding van kapitein Frans Banninck Cocq, bekend als de Ô
ÇÿNachtwachtÔÇÖ, Rembrandt Harmensz. van Rijn, 1642
    showImage: true
    permitDownload: true
    webImage:
      guid: 3ae88fe0-021c-41ae-a4ce-cc70b7bc6295
      offsetPercentageX: 50
      offsetPercentageY: 100
      width: 2500
      height: 2034
      url: http://lh6.ggpht.com/ZYWwML8mVFonXzbmg2rQBulNuCSr3rAaf5ppNcUc2Id8qXqudDL1NSYxaqjEXyDLSbeN
FzOHRu0H7rbIws0Js4d7s_M=s0
-- Más  --
hellishvictor commented 4 weeks ago

#177 solved this.

01mf02 commented 3 weeks ago

Great!