Skip to content

Instantly share code, notes, and snippets.

@mirekfranc
Created April 19, 2017 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirekfranc/16d4488f6b9a3463ff4f4040a5e2a761 to your computer and use it in GitHub Desktop.
Save mirekfranc/16d4488f6b9a3463ff4f4040a5e2a761 to your computer and use it in GitHub Desktop.
ascii to unicode form feed...
#include <fstream>
#include <iterator>
int main(int argc, char *argv[])
{
std::fstream is, os;
if (argc < 3)
return 1;
is.open(argv[1], std::ios::binary | std::fstream::in);
os.open(argv[2], std::ios::binary | std::fstream::out);
for (std::istreambuf_iterator<char> i(is), e; i != e; ++i)
if(*i == 12)
os << static_cast<char>(0xe2) << static_cast<char>(0x90) << static_cast<char>(0x8c);
else
os << *i;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment