Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between \015 & \012 and \r & \n

I have an old C++ program that is writing files and FTPing them to a IBM mainframe.

This program is being converted to C#.

Things seems OK in transferring but the mainframe viewer is not displaying the file properly.

What is the difference between \015 & \012 and \r & \n? C++ is using the numbers and C# is using \r\n.

Could this be why things don't appear properly?

The files are getting transferred as ASCII so unsure why it appears like garbage!

like image 461
Jon Avatar asked Mar 27 '11 02:03

Jon


1 Answers

\015 is an octal literal, which C# does not support.
C# parses it as \0 (character code zero) followed by the two characters 15

like image 68
SLaks Avatar answered Nov 14 '22 08:11

SLaks