Comments (8)
Really hope jo
could add an option to support reading the raw content of a file as a string.
from jo.
I'm not hugely in favor of a switch to toggle that behaviour. Would a separate character make sense? <filename
, reminischent of shell input.
BTW, if we do implement this, the underlying JSON routines will not handle binary zero \00
, so I'm not sure how useful this would be.
from jo.
It made sense to me/us to have that stripped.
Why would you not want it stripped?
from jo.
We should probably amend the description in the man page.
from jo.
But I want to make a json with the exact content of a file as it-is. Could I archieve this with jo
? Maybe we could add a option (like -raw
)?
from jo.
The only solution which occurs to me right now is to transport with base64 and then decode on the receiving end:
$ echo hello > test.txt
$ jo 'test=%test.txt'
{"test":"aGVsbG8K"}
$ echo aGVsbG8K | base64 -d
hello
$ echo aGVsbG8K | base64 -d | od -cb
0000000 h e l l o \n
150 145 154 154 157 012
0000006
from jo.
It made sense to me/us to have that stripped.
Why would you not want it stripped?
It would invalidate any checksum or signature on the content of that file.
from jo.
Since trimming the output has been the default operation for years with no complaints until now, it might not be desirable to unilaterally switch to verbatim inclusion mode by default.
I guess we could add a -l
(for literal) switch, and document current behavior.
from jo.
Related Issues (20)
- Gaps in variable HOT 2
- Delete nested element HOT 5
- Assertion `utf8_validate(str)' failed - again? HOT 9
- Generating JSON and including JSON output from another program appears to result in double encoded JSON? HOT 3
- Suberflous `\` if try to escape `}` in value HOT 8
- feature allow string vals with spaces deep nested HOT 1
- Question: how to produce multiline strings? HOT 2
- UTF-8 crash - `Assertion failed: (utf8_validate(str))` HOT 5
- Passing an empty file with `@` syntax now throws an error on 1.7 HOT 5
- FAIL: tests/jo.test 20 - read json array elements HOT 7
- 1.9 build for Windows missing HOT 1
- Dynamic array of nested oneofs HOT 1
- Disable type coercion HOT 6
- possible bug: use of `-a` on outer command in nested jo fails to render inside object element when space exists in internal object property value HOT 2
- Modifications to GPLv2 license make jo difficult to adopt in enterprise environment HOT 2
- Please support empty array HOT 1
- pass multiple variables to jo? HOT 3
- jo extends fractional part of some floats HOT 2
- String coercion creates empty string from "null" value HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jo.