#include <TransferEncoding.h>
|
| static ByteString | decode (const ByteString &_str) |
Definition at line 31 of file TransferEncoding.h.
◆ decode()
| ByteString QuotedPrintableDecoder::decode |
( |
const ByteString & | _str | ) |
|
|
static |
Definition at line 116 of file TransferEncoding.cpp.
117{
119
121 ByteBuffer* buf = ByteBuffer::create(_str.length());
123
124 size_t i = 0;
125 size_t j = 0;
126 while(src[i]) {
127 if ('=' == src[i]) {
128
129 if (src[i + 1] && src[i + 2]
130 && isxdigit(src[i + 1]) && isxdigit(src[i + 2])
131 ) {
132 dest[j++] = (
hex2int(src[i + 1]) << 4)
134 i += 3;
135 }
136 else {
137
138 int k = 1;
139 while(src[i + k] &&
140 ((src[i + k] ==
' ') || (src[i + k] ==
TAB))
141 ) {
142
143 k++;
144 }
145
146 if (!src[i + k])
147 i += k;
148 else if ((src[i + k] ==
CR) && (src[i + k + 1] ==
LF))
149 i += k + 2;
150 else if ((src[i + k] ==
CR) || (src[i + k] ==
LF))
151 i += k + 1;
152 else
153 dest[j++] = src[i++];
154 }
155 }
156 else {
157
158 dest[j++] = src[i++];
159 }
160 }
161
164 buf->__dataLength = j;
165
167 buf->release();
169}
#define __DCL_ASSERT(expr)
The documentation for this class was generated from the following files: