Index: common/gsm-encoding.c =================================================================== --- common/gsm-encoding.c (revision 3868) +++ common/gsm-encoding.c (working copy) @@ -703,13 +703,33 @@ iconv_close(cd); *pout = 0; #else + // Reference: http://kellyjones.netfirms.com/webtools/ascii_utf8_table.shtml + char utf_0xc2[]={'¡','¢','£','¤','¥','|','§','¨','©','ª','«','¬','-','®','¯', + '°','±','2','3','´','u','¶','·','¸','1','º','»','?','?','?','¿'}; //31 + + char utf_0xc3[]={'À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í', + 'Î','Ï','?','Ñ','Ò','Ó','Ô','Õ','Ö','x','Ø','Ù','Ú','û','Ü','Ý','?', + 'ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï', + '?','ñ','ò','ó','ô','õ','ö','÷','#','ù','ú','Û','ü','?','?','ÿ'}; //65 + unsigned char *pin, *pout; pin = (unsigned char *)instring; pout = outstring; while (inlen > 0 && outlen > 0) { - if (*pin < 0x80) { + // Convert multiple byte UTF8 characters to ASCII + if ((*pin==0xc2 || *pin == 0xc3) && inlen>1) { + *pout = '?'; + + //checking limits, 31 and 65 are the number of characters + if ( (*pin == 0xc2 && *(pin+1) >= 0x80 && *(pin+1) <= 0x80+31) || + (*pin == 0xc3 && *(pin+1) >= 0x80 && *(pin+1) <= 0x80+65) ) { + if (*pin == 0xc2) *pout = utf_0xc2[*(pin+1)-0x80]; + if (*pin == 0xc3) *pout = utf_0xc3[*(pin+1)-0x80]; + } + nconv = 2; + } else if (*pin < 0x80) { *pout = *pin; nconv = 1; } else if (*pin < 0xc0) { Index: common/vcal.c =================================================================== --- common/vcal.c (revision 3868) +++ common/vcal.c (working copy) @@ -351,8 +351,15 @@ break; default: /* summary goes into text */ - /* TODO: UTF8 --> ascii */ str = icalcomponent_get_summary(compresult); + if (str!=NULL) { + const char *tempstr; + tempstr=malloc(strlen(str)); + + utf8_decode(tempstr, strlen(str), str, strlen(str)); + strncpy(str,tempstr,strlen(str)); + free(tempstr); + } break; } if (str) {