3 ms·
They say JSON is not for binary and won't change. With a backslash (oops reverse solidus) you could send binary data - eg an image. { myimage: "\01\02\03" }
by ape4 13y ago
They say JSON is not for binary and won't change. With a backslash (oops reverse solidus) you could send binary data - eg an image. { myimage: "\01\02\03" } of course, not efficient. You could base64-encode it and put that in a string. I think some syntax for binary would be useful - eg { myimage: 0x010203 }
- chimeracoder 13y agoThe slash and the solidus are two separate entities. I am not aware of any use of the actual solidus being used for escaping.
- ape4 13y agoI am talking about BACKslash (REVERSE solidus). This says they are the same: http://en.wikipedia.org/wiki/Backslash http://en.wikipedia.org/wiki/Backslash
- chimeracoder 13y agoInteresting. It says they're the same thing, but then the two characters listed on the page (the regular backslash and the Unicode variant) are rendered noticeably differently. I can't imagine why they changed the name, given that the forward slash and the solidus are not interchangeable. http://www.fileformat.info/info/unicode/char/5c/index.htm http://www.fileformat.info/info/unicode/char/5c/index.htm
- nknighthb 13y agoLook at the HTML. The "unicode variant" is rendered differently because the code tells the browser to render it differently, not because it's a different character. <span style="font-size:125%"><span class="Unicode">\</span></span>
- chimeracoder 13y agoAh, thanks. I was on my phone and didn't think to check the source. EDIT: Actually, this explanation is enlightening: http://en.wikipedia.org/wiki/Slash_(punctuation)#Encoding http://en.wikipedia.org/wiki/Slash_(punctuation)#Encoding
- spullara 13y agoA jpg base64 encoded and gzipped is similar in size to the original jpg. It isn't as bad as you might think.