Coder Social home page Coder Social logo

Comments (3)

tkurki avatar tkurki commented on May 24, 2024

This value is from real world actisense capture:

$ echo '2014-08-15-10:02:21.634,6,129810,43,255,33,18,ec,4a,b6,0d,24,53,52,54,44,54,22,3a,4f,48,32,36,39,32,40,78,00,28,00,0a,00,6e,00,00,00,00,00,00' | analyzer -json 
INFO 2014-08-17 20:32:10.637 [analyzer] New PGN 129810 for device 43 (heap 7809 bytes)
{"timestamp":"2014-08-15-10:02:21.634","prio":"6","src":"43","dst":"255","pgn":"129810","description":"AIS Class B static data (msg 24 Part B)","fields":{"Message ID":"24","Repeat indicator":"Initial","User ID":"230050540","Type of ship":"Sailing","Vendor ID":"SRTDT":","Callsign":"OH2692","Length":"12.0","Beam":"4.0","Position reference from Starboard":"1.0","Position reference from Bow":"11.0","Mothership User ID":"0","Reserved":"0","Spare":"0"}}
$ echo '2014-08-15-10:02:21.634,6,129810,43,255,33,18,ec,4a,b6,0d,24,53,52,54,44,54,22,3a,4f,48,32,36,39,32,40,78,00,28,00,0a,00,6e,00,00,00,00,00,00' | analyzer -json  | json
INFO 2014-08-17 20:32:14.582 [analyzer] New PGN 129810 for device 43 (heap 7809 bytes)
json: error: input is not JSON: Expected ',' instead of ':' at line 1, column 268:
        {"timestamp":"2014-08-15-10:02:21.634","prio":"6","src":"43","dst":"255","pgn":"129810","description":"AIS Class B static data (msg 24 Part B)","fields":{"Message ID":"24","Repeat indicator":"Initial","User ID":"230050540","Type of ship":"Sailing","Vendor ID":"SRTDT":","Callsign":"OH2692","Length":"12.0","Beam":"4.0","Position reference from Starboard":"1.0","Position reference from Bow":"11.0","Mothership User ID":"0","Reserved":"0","Spare":"0"}}
        ...........................................................................................................................................................................................................................................................................^
{"timestamp":"2014-08-15-10:02:21.634","prio":"6","src":"43","dst":"255","pgn":"129810","description":"AIS Class B static data (msg 24 Part B)","fields":{"Message ID":"24","Repeat indicator":"Initial","User ID":"230050540","Type of ship":"Sailing","Vendor ID":"SRTDT":","Callsign":"OH2692","Length":"12.0","Beam":"4.0","Position reference from Starboard":"1.0","Position reference from Bow":"11.0","Mothership User ID":"0","Reserved":"0","Spare":"0"}}

from canboat.

keesverruijt avatar keesverruijt commented on May 24, 2024

OK, another case of strange data in some fields not being escaped (or suppressed) properly.

from canboat.

tkurki avatar tkurki commented on May 24, 2024

How about fixing this issue once and for all by properly escaping json value output? Would something like https://github.com/json-c/json-c/blob/master/json_object.c#L100 work? Requires an extra buffer at least.

As witnessed earlier I am no C wizard, but can give it a try later on.

from canboat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.