-------------------- No measures Before chomp() 0x41 0x42 0x43 0xd 0xa After chomp() 0x41 0x42 0x43 0xd Before chomp() 0x44 0x45 0x46 0xd 0xa After chomp() 0x44 0x45 0x46 0xd -------------------- Change default line terminator Before chomp() 0x41 0x42 0x43 0xd 0xa After chomp() 0x41 0x42 0x43 Before chomp() 0x44 0x45 0x46 0xd 0xa After chomp() 0x44 0x45 0x46 -------------------- open() with :crlf I/O layer Before chomp() 0x41 0x42 0x43 0xa After chomp() 0x41 0x42 0x43 Before chomp() 0x44 0x45 0x46 0xa After chomp() 0x44 0x45 0x46 --------------------