Fix: translate charsets with any level, not only levels 1 & 2. A 256-bytes character map for UTF8 is violates FSC-54, but this document is obsoleted. Bugreport from Michiel van der Vlist 2:280/5555.

This commit is contained in:
Stas Degteff 2008-01-19 17:28:14 +00:00
parent 57276e577d
commit abb435a4ad
2 changed files with 4 additions and 7 deletions

View File

@ -158,7 +158,7 @@ char* mime_header_encode(char* dest, const char* source, GMsg* msg) {
if(*msg->charset) if(*msg->charset)
{ {
int level = msg->charsetlevel; int level = msg->charsetlevel;
if (((level == 1) || (level == 2)) && ChsTP) if (ChsTP)
{ {
char chln, *d = temp_src; char chln, *d = temp_src;

View File

@ -1887,7 +1887,6 @@ char* XlatStr(char* dest, const char* src, int level, Chs* chrtbl, int qpencoded
defaultchardo: defaultchardo:
dochar = *sptr++; dochar = *sptr++;
chardo: chardo:
// Translate level 1 and 2
#ifdef HAS_ICONV #ifdef HAS_ICONV
if( iconv_cd!=(iconv_t)(-1) ){ if( iconv_cd!=(iconv_t)(-1) ){
unsigned srcleft=1; unsigned srcleft=1;
@ -1913,7 +1912,7 @@ char* XlatStr(char* dest, const char* src, int level, Chs* chrtbl, int qpencoded
else else
#endif #endif
if (((level == 1) || (level == 2)) && chrs) if (chrs)
{ {
tptr = (char*)chrs[(byte)dochar]; tptr = (char*)chrs[(byte)dochar];
clen = *tptr++; clen = *tptr++;
@ -2128,8 +2127,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) {
// Insert previous quotestring // Insert previous quotestring
for(n=0; n<qlen; n++) for(n=0; n<qlen; n++)
{ {
// Translate level 1 and 2 if (ChsTP)
if (((level == 1) || (level == 2)) && ChsTP)
{ {
tptr = (char*)ChsTP[(byte)(*qptr++)]; tptr = (char*)ChsTP[(byte)(*qptr++)];
chln = *tptr++; chln = *tptr++;
@ -2605,8 +2603,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) {
defaultchardo: defaultchardo:
dochar = *ptr++; dochar = *ptr++;
chardo: chardo:
// Translate level 1 and 2 if (ChsTP)
if (((level == 1) || (level == 2)) && ChsTP)
{ {
tptr = (char*)ChsTP[(byte)dochar]; tptr = (char*)ChsTP[(byte)dochar];
chln = *tptr++; chln = *tptr++;