1

Goal: Transferring a file from client to the server.

Environment: Linux

Problem:

  1. When opening the incompletely copied file in the server, it looks like there is a "^M" character in the place of new line.
EasyQuestions
  • 327
  • 1
  • 10
  • 23

2 Answers2

0

^M (one character) is 0x0D

NewLine char on Linux is 0x0A

NewLine char on Windows is 0x0D 0x0A (2 characters)

So 0x0D,0x0A will be displayed as ^M,NewLine (depends on which editor you use, what I said is correct with VIM)

BTW, if you want to input a ^M, you need to press ctrl+v, then ctrl+m (In VIM)

agou
  • 728
  • 1
  • 10
  • 24
0

Open the file in binary mode. In text mode newline is represented as /r/n.

akhil
  • 732
  • 3
  • 13