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

Function rfc2047_test

lib_acl_cpp/samples/rfc2047/main.cpp:76–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76static void rfc2047_test(acl::rfc2047& rfc2047, const char* s)
77{
78 acl::string out;
79
80 printf("\r\n\r\n");
81 printf("------------------ src --------------------------------\r\n");
82 printf("%s\r\n", s);
83 printf("------------------ charset to gb2312 begin ------------\r\n");
84 rfc2047.reset(true);
85 rfc2047.decode_update(s, (int) strlen(s));
86 if (rfc2047.decode_finish("gb18030", &out))
87 {
88 printf(">>>before valid |%s|, len(%d)\r\n", out.c_str(), (int) out.size());
89
90 char buf[50];
91
92 get_valid_string(out.c_str(), (unsigned) out.length(),
93 buf, (unsigned) sizeof(buf) - 3);
94 printf(">>>after valid |%s|, len(%d)\n", buf, (int) strlen(buf));
95
96 rfc2047.debug_rfc2047();
97 }
98 else
99 printf(">>error: %s\n", out.c_str());
100 printf("------------------ charset to gb2312 end ---------------\n");
101}
102
103static void rfc2047_test2(acl::rfc2047& rfc2047, const char* s)
104{

Callers 1

mainFunction · 0.85

Calls 8

get_valid_stringFunction · 0.85
debug_rfc2047Method · 0.80
resetMethod · 0.45
decode_updateMethod · 0.45
decode_finishMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…