Created
April 19, 2017 21:58
-
-
Save mirekfranc/16d4488f6b9a3463ff4f4040a5e2a761 to your computer and use it in GitHub Desktop.
ascii to unicode form feed...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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