20 for(std::size_t i = 0; i < line.size(); i++)
22 const char ch = line[i];
27 else if(ch ==
'\r' || ch ==
'\n')
30 else if((ch & 0x80) != 0)
32 std::cout <<
"\\x" << std::hex << (unsigned(ch) & 0xff) << std::dec;
38 std::cout <<
"\\n\"\n";
41 int main(
int argc,
char *argv[])
45 for(
int i = 1; i < argc; ++i)
47 std::ifstream input_file(argv[i]);
51 std::cerr <<
"Failed to open " << argv[i] <<
'\n';
55 while(getline(input_file, line))
int main(int argc, char *argv[])
static void convert_line(const std::string &line)