Fixed ISO to latin conversion

This commit is contained in:
Alexander S. Aganichev 2001-10-29 10:49:18 +00:00
parent 54d160f575
commit 7f90a6d53d
3 changed files with 7 additions and 3 deletions

View File

@ -12,6 +12,10 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
- Fixed bug in Latin-x to ISO-8859-x converter, now charset in
Internet mail should be properly specifyed as ISO rather than as
Latin.
- When you change mail to the UUCP gate and InternetRFCBody is on - When you change mail to the UUCP gate and InternetRFCBody is on
GoldED+ WILL insert new To: line in the message, stripping old one. GoldED+ WILL insert new To: line in the message, stripping old one.

View File

@ -171,7 +171,7 @@ char* mime_header_encode(char* dest, const char* source, GMsg* msg) {
if(not inmime) { if(not inmime) {
if(msg->charset) { if(msg->charset) {
bp = stpcpy(bp, "=?"); bp = stpcpy(bp, "=?");
if(strneql(msg->charset, "latin", 5)) { if(strnieql(msg->charset, "latin", 5)) {
bp = Latin2ISO(bp, msg->charset); bp = Latin2ISO(bp, msg->charset);
} }
else { else {
@ -497,7 +497,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
char encoding[100]; char encoding[100];
bool isusascii = striinc("ASCII", msg->charset); bool isusascii = striinc("ASCII", msg->charset);
bool isqp = not isusascii and IsQuotedPrintable(msg->charset); bool isqp = not isusascii and IsQuotedPrintable(msg->charset);
if(strneql(msg->charset, "latin", 5)) if(strnieql(msg->charset, "latin", 5))
Latin2ISO(encoding, msg->charset); Latin2ISO(encoding, msg->charset);
else if(isusascii) else if(isusascii)
strcpy(encoding, "us-ascii"); strcpy(encoding, "us-ascii");

View File

@ -2733,7 +2733,7 @@ char *Latin2ISO(char *iso_encoding, const char *latin_encoding) {
char *ISO2Latin(char *latin_encoding, const char *iso_encoding) { char *ISO2Latin(char *latin_encoding, const char *iso_encoding) {
static const char *latinno[] = { NULL, "1", "2", "3", "4", NULL, NULL, NULL, NULL, "5", "6", NULL, NULL, "7", "8", "9" }; static const char *latinno[] = { NULL, "1", "2", "3", "4", NULL, NULL, NULL, NULL, "5", "6", NULL, NULL, "7", "8", "9" };
int chsno = atoi(iso_encoding+9); int chsno = atoi(strstr(iso_encoding, "8859")+5);
chsno = chsno > sizeof(latinno)/sizeof(const char *) ? 0 : chsno; chsno = chsno > sizeof(latinno)/sizeof(const char *) ? 0 : chsno;
if(latinno[chsno] == NULL) if(latinno[chsno] == NULL)
return strxmerge(latin_encoding, 12, iso_encoding, NULL); return strxmerge(latin_encoding, 12, iso_encoding, NULL);