4 ms·
I don't know. I personally think plain text is a more important file format. It's read and writeable by a million programs. Any first year programming student c
by irrational 8y ago
I don't know. I personally think plain text is a more important file format. It's read and writeable by a million programs. Any first year programming student can easily build their own program to read and write plain text. It is fairly easily parseable. Etc.
I just opened a random PDF on my computer in a text editor and it starts off with "xÕ\ko‹∆˝Œ_1@ÉbD 9|ÌËáƒZçÌDJÇ¢)UZ[nıÚÆÏƒA˛Pˇeœπ"
- SllX 8y agoArguably it actually is plain text, but I think you can build a case for at least a dozen file formats that they’re the most important file format in the world, so arguably, none of them are.
- SigmundA 8y agoIt also very inefficient especially if you want things like images embedded in it. Its not like you can read text without the right program, its still binary, there just happens to be a mostly agreed upon standard and a lot of programs that can decode that standard and render to screen. PDF viewers are built into most browsers now and allows rich page perfect print ready results. If I had it my way we would settle on a binary data serialization format, I don't care MsgPack, Protobuf, heck maybe even sqlite and then everyone could have a viewer to snoop around in it. You would still have to understand whats being encoded but you could always "view source" so to speak.
- bluedino 8y agoIt's plenty efficent. It's just a container for an image. It's really, really efficent if you use vector graphics.
- SigmundA 8y agoAre you talking about text? No base64 is not an efficient way to store raster images, neither is vector markup.
- pierrebai 8y agoPDF don't need to use base64. (nor base85). They can embed pure binary just fine. A PDF with a JPG is just a few more bytes than the raw JPG. Same for text. Text can be pure text,but for space saving, it usually will be deflate-compressed.
- SigmundA 8y agoRight so your talking about PDF and not text, I agree PDF are efficient as they are a binary format.
- echeese 8y agoPDF files begin with %PDF, not sure you have a valid PDF there
- irrational 8y agoTrue. I just skipped the header lines and grabbed the start of the lines after the headers.
- Someone 8y agoNo, it doesn’t. PDF files start with “%PDF” (https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files https://en.wikipedia.org/wiki/Magic_number_(programming)#Mag...)
- ip26 8y agoUsing your goalposts I'd argue a paper napkin is the most important file format. It's readable & writeable by 7 billion wetware programs, including the drunk ones, and even a first grader can make use of it.
- mattnewton 8y agoI don’t know what is worse, extracting text from a napkin or a PDF. At least with the napkin you know it is going to be lossy going in.
- jcranmer 8y agoI'm not sure how you got that string, since there's no charset except full-Unicode ones that would contain both ∆ and œ, and compressed binary text isn't going to appear to be UTF-16 or UTF-8, so I don't see any obvious charset you could be using. Hmm. Maybe your charset is Windows-1253, and unassigned characters are being supplanted with the equivalent codepoints from Windows-1252?
- AnaniasAnanas 8y agoThe solution to that is postscript. I still see quite a few papers being distributed in postscript form.
- jonathanyc 8y agoPDF files start with %PDF. You’re probably looking at DEFLATEd or binary data. What do you expect?
- cosmie 8y agoPlain text can be a really problematic format for data preservation. - While it's fairly easy to read and write plain text, it's also fairly easy to inadvertently introduce unintended artifacts in the process. - The more frequently a file gets passed around and read and written to, the more likely mojibake[1] will get introduced. This concern rises exponentially when you move to non-US audiences and introduce local-specific encodings. File storage settings, client operating system settings, server configuration settings, database settings, programming languages that touch it along the way. All of them introduce assumptions along the way of a file's encoding, and many failure cases can be subtle and easily go unnoticed at a glance while causing some irreversible damage to downstream recipients. - Even if you solve for the encoding, you still have structural issues with tabular data. Different parsers treat escaping and quoting policies differently. This can result in data shifts as things get mis-parsed, data corruptions if literal values get interpreted as escape characters or vis versa, etc. For preserving data, generic plain text tends to get worse and worse over time because it's such a non-opinionated format and even if you document the specifics on econdings and parsing details it's easy for those to get lost over time as things exchange hands or for intermediaries to corrupt the plaintext because they relied on defaults instead of the documented parsing details. For better or worse, PDF tends to solve the preservation issue while introducing potential barriers on the parsing/processing side. [1] https://en.wikipedia.org/wiki/Mojibake https://en.wikipedia.org/wiki/Mojibake
- upofadown 8y ago>mojibake These days, those that are promoting the idea of plain text as a long term archive format are assuming UTF-8 by default.
- mkl 8y agoActually, PDF is primarily a text format, it's just usually compressed, and often contains embedded binary content like fonts and images. You can see the text code by doing something like this: pdftk input.pdf output input_uncompressed.pdf uncompress You can also edit it in that state, in an editor that preserves binary content, but there's a hard-coded offset table at the end, so if you change the length of something, that needs updating (very fiddly to attempt by hand, but automatable, and some pdf tools automatically fix broken offset tables).
- freddie_mercury 8y agoThere's really no such thing as "plain-text". Maybe you mean ASCII, which is indeed simple and also not useful for several billion people. (I live in one of the many countries that cannot use ASCII -- the American Standard Code for Information Interchange -- because don't speak American here.) Or maybe you mean Unicode which is an extremely long spec and absolutely cannot be handled by a first year programming student.