--- gnokii-20070406/common/vcal.c 2007-04-06 17:00:08.000000000 +0200 +++ gnokii-20070406.carles/common/vcal.c 2007-04-06 22:52:56.000000000 +0200 @@ -332,17 +332,34 @@ switch (calnote->type) { case GN_CALNOTE_CALL: /* description goes into text */ - /* TODO: UTF8 --> ascii */ + /* TODO: UTF8 --> ascii || Done! (some lines below) */ + snprintf(calnote->phone_number, GN_CALNOTE_NUMBER_MAX_LENGTH-1, "%s", icalcomponent_get_summary(compresult)); str = icalcomponent_get_description(compresult); break; default: /* summary goes into text */ - /* TODO: UTF8 --> ascii */ + /* TODO: UTF8 --> ascii || Done! (some lines below) */ str = icalcomponent_get_summary(compresult); break; } if (str) { + //Convert from UTF8 to ascii, in same memory zone (ascii is equal or smaller) + int str_len,asciilen; + char *ascii = NULL; + + str_len = strlen(str); + + ascii = malloc(str_len + 1); + /* TODO: utf8_decode maybe doesn't decode to ASCII + (to some local settings). Do a function to + decode always to ASCII */ + utf8_decode(ascii,asciilen,str,str_len); + + memcpy(str,ascii,str_len + 1); + free(ascii); + ascii = NULL; + snprintf(calnote->text, GN_CALNOTE_MAX_LENGTH - 1, "%s", str); }