Copying calendar and contacts from Kontact to an iPod with the proper encoding

Copying your personal data to an iPod is surprisingly easy:
Calendar: export your calendar as an iCal file (File->Export…) and copy it to the Calendars directory on your mounted iPod (e.g. /media/MYIPOD/Calendars)
Address book: File->Export->Export vCard…, take care to export your contact list to several files. Copy to the Contacts directory on your iPod.
It's getting a bit trickier if you have special characters in your files, as these have to be converted from Kontact's UTF-8 to the iPod's ISO_8859-15 encoding. Recoding can be done by iconv with a shell script. Run from the directory where vCards and calendar have been exported to:
for f in $FILES;
  iconv -f UTF-8 -t ISO_8859-15 $f >00_$f
  mv 00_$f /media/MYIPODSNAME/Contacts/$f
  echo $f
iconv -f UTF-8 -t ISO_8859-15 *.ics > 00_mycal.ics
mv 00_mycal.ics /media/MYIPODSNAME/Calendars/mycal.ics
echo mycal.ics

No comments: