, , , , UTF-16 ( ) . , , gets - UTF-16le, 0x0a 0x00, gets ( strip ) 0x0a.
: ,
ab
cd
UTF-16le.
0x61 0x00 0x62 0x00 0x0a 0x00 0x63 0x00 0x64 0x00 0x0a 0x00
a b \n c d \n
gets 0x0a, strip , 0x61 0x00 0x62 0x00, iconv UTF-8 0x61 0x62 - "ab". gets 0x0a, strip , line 0x00 0x63 0x00 0x64 0x00, - , iconv , , .
/ , , gets "\n" ("\x0a") "\x0a\x00", strip, encoding-clean print puts, ( , ).
Windows, CRLF Windows UTF-16le "\x0d\x00\x0a\x00".