Skip to content

Commit

Permalink
Change Charset for Hash calculation (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas0b1011001 authored Feb 16, 2024
1 parent 17cde1a commit f5c8eb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Helpers.gs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function parseResponses(responses){

result.forEach(function(event){
if (!event.hasProperty('uid')){
event.updatePropertyWithValue('uid', Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, event.toString()).toString());
event.updatePropertyWithValue('uid', Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, event.toString()).toString(), Utilities.Charset.UTF_8);
}
if(event.hasProperty('recurrence-id')){
let recID = new ICAL.Time.fromString(event.getFirstPropertyValue('recurrence-id').toString(), event.getFirstProperty('recurrence-id'));
Expand Down Expand Up @@ -348,7 +348,7 @@ function createEvent(event, calendarTz){
return;
}

var digest = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, icalEvent.toString()).toString();
var digest = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, icalEvent.toString(), Utilities.Charset.UTF_8).toString();
if(calendarEventsMD5s.indexOf(digest) >= 0){
Logger.log("Skipping unchanged Event " + event.getFirstPropertyValue('uid').toString());
return;
Expand Down

0 comments on commit f5c8eb5

Please sign in to comment.