Manage \0, \n, \r and \t correctly in strings