We are trying to use Zoho incoming email to form functionality and it works, but when customers attach files that contain international characters (letters with accents, etc.) then Microsoft Outlook has MIME-encoded the names of these files. Zoho totally ignores this and stores these attachments with totally wrong filenames.
One example:
This file:
Minikonkurranse_Bistand_til_produkteier_økonomisystemene.doc
is saved only with a totally unreadable mime-encoded name:
=_Windows-1252_Q_Minikonkurranse_Bistand_til_produkteier_=F8konomisysteme_=_=_Windows-1252_Q_ne.doc_=
This is not only ugly, it also breaks the Zoho behavior so that such files cannot be opened in Zoho.
I have made a Python service that can mime-decode such names and here you have it so that you can try to implement the same routine inside Zoho and use it on mime-encoded international file-names. You may need to translate it to NodeJS or other languages, and for that I recommend using ChatGPT. Here is the Python version I use:
import quopri
def decode_mime_string(s):
if '=' in s:
start = s.find('=')
prefix = s[:start]
mimestring = s[start:]
mime_elements = mimestring.split('=_=')
decoded_text = ''
for submime in mime_elements:
charset, encoded_text = submime.strip('=_').strip('_=').split('_Q_', 1)
decoded_text += quopri.decodestring(encoded_text).decode(charset)
return prefix + decoded_text
else:
return s
Hope to see a fix for this bug soon!
Best regards,
Eirik Y. Øra, +47 919 06 353