add charset for ical

this hopefully fixes the google.cal issue
minor refactoring & fix
Merge pull request #340 from leider/master

add charset for ical