#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 122 of file TransferEncoding.cpp.
123{
125
127 ByteBuffer*
buf = ByteBuffer::create(_str.length());
129
130 size_t i = 0;
131 size_t j = 0;
132 while(src[i])
133 {
134 if ('=' == src[i])
135 {
136
137
138 if (src[i + 1] && src[i + 2]
139 && isxdigit(src[i + 1]) && isxdigit(src[i + 2]))
140 {
141 dest[j++] = (
hex2int(src[i + 1]) << 4)
143 i += 3;
144 }
145 else
146 {
147
148 int k = 1;
149 while(src[i + k] &&
150 ((src[i + k] ==
' ') || (src[i + k] ==
TAB)))
151 {
152
153 k++;
154 }
155
156 if (!src[i + k])
157 i += k;
158 else if ((src[i + k] ==
CR) && (src[i + k + 1] ==
LF))
159 i += k + 2;
160 else if ((src[i + k] ==
CR) || (src[i + k] ==
LF))
161 i += k + 1;
162 else
163 dest[j++] = src[i++];
164 }
165 }
166 else
167 {
168
169 dest[j++] = src[i++];
170 }
171 }
172
175 buf->__dataLength = j;
176
180}
#define __DCL_ASSERT(expr)
The documentation for this class was generated from the following files: