top | item 46869197

(no title)

dgan | 27 days ago

I am just wondering how it is good idea for a sever to insert some characters into user's input. If a collegue were to propose this, i d laugh in his face

It's just sp hacky i cant belive it's a real life's solution

discuss

order

jagged-chisel|27 days ago

“Insert characters”?

Consider converting the original text (maintaining the author’s original line wrapping and indentation) to base64. Has anything been “inserted” into the text? I would suggest not. It has been encoded.

Now consider an encoding that leaves most of the text readable, translates some things based on a line length limit, and some other things based on transport limitations (e.g. passing through 7-bit systems.) As long as one follows the correct decoding rules, the original will remain intact - nothing “inserted.” The problem is someone just knowledgeable enough to be aware that email is human readable but not aware of the proper decoding has attempted to “clean up” the email for sharing.

dgan|27 days ago

Okey it does sound better from this POV. Still wierd as its a Client/UI concern, not something a server is supposed to do; whats next,adding "bold" tags on the title? Lol

flexagoon|27 days ago

When you post a comment on HN, the server inserts HTML tags into your input. Isn't that essentially the same thing?

dgan|27 days ago

No, because there is a clear separation between the content and the envelop. You wouldnt expect the post office to open your physical letters and write routing instructions to the postmen for delivery

But I agree with sibling comment: it makes more sense when its called "encoding" instead of "inserting chars into original stream"

direwolf20|27 days ago

It's called escaping, and almost every protocol has it. HN must convert the & symbol to & for displaying in HTML. Many wire protocols like SATA or Ethernet must insert a 1 after a certain number of consecutive 0s to maintain electrical balance. Don't remember which ones — don't quote me that it's SATA and Ethernet.

zoho_seni|27 days ago

Protocols that literally insert a bit are HDLC / PPP / CAN and they insert a 0 after a few 1s

yencabulator|24 days ago

Wait till you hear about HTTP chunked encoding.

layer8|27 days ago

Just wait until you learn what mess UTF-8 will turn your characters into. ;)