Hi @codeyourweb Welcome! i have encountered this same issue with that subject field, i have used n8n-nodes-text-manipulation community node and that fixed my issue as i added that node before the gmail node with decode html legacy to send exactly what i wanted, but you can even try using code node i have not personally tried using that but code node with normalizing the string can be a fix like:
// Force correct UTF-8 decoding if the string is double-encoded
const subject = Buffer.from(yourSubjectString, 'latin1').toString('utf8');
return [{ json: { subject } }];
Although this can sometimes be lossy in some cases but it is worth giving a try, using replaceSpecialChars() is good but it will eventually loose the meaning in some word cases. Let me know how that code node and community node performs in your use case.
Hi, Thank you for this answer. I’ve tried with Buffer on my previous tests but i didn’t worked. I used n8n-nodes-text-manipulation and it works perfectly with these parameters:
yeah, this is the classic double-UTF8 encoding issue. it happens when the expression gets evaluated and the string gets encoded again before sending to Gmail. try using Buffer and explicitly set charset in your code node before passing to gmail – something like Buffer.from(subject, ‘utf8’).toString(‘utf8’) or use btoa/atob if that doesn’t work. let me know if that helps
yeah, this is the classic double-UTF8 encoding issue. it happens when the expression gets evaluated and the string gets encoded again before sending to Gmail. try using Buffer and explicitly set charset in your code node before passing to gmail – something like Buffer.from(subject, ‘utf8’).toString(‘utf8’) or use btoa/atob if that doesn’t work. let me know if that helps