in reply to Transforming "\r\n" to '\012\015'

Hum, I have duly read your comments in the last paragraph, but still don't understand why you want to do this.

Octal, decimal or hexadecimal are just representations of numbers. Under the hood, it is all binary, you usually don't have to worry.

Granted, there are some protocols and commands that require being passed an octal representation, such as the chmod command because of (retrospectively slightly unfortunate, but probably justified at the time) decisions made by the Unix designers some 40 year ago.

But as for changing "\r\n" to their octal representations, I can't see any real use case nowadays.