30 likes | 140 Vues
Coding and Formatting Data for Network Use. Syntax – Format (2-bytes for port number) Semantics – Meaning of Allowed Content (binary 16-bit number, Port number 0 to 65,535). End-Line (s) ---------------------- Teletype, MSDOS, Internet: LF and CR ---------------------- UNIX:
E N D
Coding and Formatting Datafor Network Use Syntax – Format (2-bytes for port number) Semantics – Meaning of Allowed Content (binary 16-bit number, Port number 0 to 65,535)
End-Line(s) ---------------------- Teletype, MSDOS, Internet: LF and CR ---------------------- UNIX: LF (^J, 0x0A) ---------------------- Mac OS Before OSX CR (^M ,0x0D) After OSX Either CR or LF ---------------------- HTML ...<br> or <p>...</p> UTF-8 Since 2007 To type control characters. hold down Control Key and type the letter in 3rd column. ( LF is typed as Control+J written as ^J ) 2
Formating (Delineating) Records 1. Fixed Field – Certain number of bits or bytes assigned. a. Fixed by convention b. Fixed by preceding length record 2. Starts at next byte, ends by control character (or control sequence) Can not include control character in data. Escape character needed for arbitrary bytes in data (variable length) Groups of records separated by another control character Padding – adding meaningless characters to match required length