Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <langinfo.h>
- #include <iconv.h>
- char buf[100] ="\376\377\060\336\060\374\060\331\060\351\060\271\060\250\060\363\060\277\060\374\060\306\060\244\060\341\060\363\060\310\0\0\0\0";
- char buf2[100];
- //char buf3[100] = "\376\377\060\336";
- char buf3[100] = "\377\376\336\060";
- char buf4[100];
- int main(int argc, char** argv)
- {
- static const char empty_codeset[] = "";
- const char *codeset = empty_codeset;
- // Application
- iconv_t dum1 = iconv_open("UTF-8", "UTF-16");
- char* p2, *p;
- size_t a = 0, b = 0;
- iconv_t conv = iconv_open("UTF-8", "UTF-16");
- p= buf, p2 = buf2;
- a = 32, b = 100;
- iconv(conv, &p, &a, &p2, &b);
- std::cout << buf2 << std::endl;
- size_t c = 32, d = 100;
- p = buf3; p2 = buf4;
- iconv(dum1, &p, &c, &p2, &d);
- std::cout << buf4 << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement