MCPcopy Create free account
hub / github.com/acl-dev/acl / rfc2047_test2

Function rfc2047_test2

lib_acl_cpp/samples/rfc2047/main.cpp:103–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103static void rfc2047_test2(acl::rfc2047& rfc2047, const char* s)
104{
105 acl::string out;
106
107 printf("\n");
108 printf("------------------ charset to utf-8 begin --------------\n");
109 rfc2047.reset(true);
110 rfc2047.decode_update(s, (int) strlen(s));
111 if (rfc2047.decode_finish("utf-8", &out))
112 {
113 printf(">>> {%s}\n", out.c_str());
114 rfc2047.debug_rfc2047();
115
116 acl::fstream fp;
117 if (fp.open_trunc("test.html"))
118 {
119 fp << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n"
120 << "<head>\r\n"
121 << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n"
122 << "</head>\r\n"
123 << "<body>\r\n";
124 fp.write(out.c_str(), out.length());
125 fp << "</body>\r\n</html>\r\n";
126 }
127 }
128 else
129 printf(">>error: %s\n", out.c_str());
130 printf("------------------ charset to utf-8 end ----------------\n");
131}
132
133static void rfc2047_test_encode(const char* s)
134{

Callers 1

mainFunction · 0.85

Calls 8

debug_rfc2047Method · 0.80
resetMethod · 0.45
decode_updateMethod · 0.45
decode_finishMethod · 0.45
c_strMethod · 0.45
open_truncMethod · 0.45
writeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…