implement special characters (\r\n\t) handling for putc