kittiu
April 9, 2024, 2:56pm
1
I have configured email account for incoming email to create document. And most of the document created is OK, but for some email, the character messed up.
�BDI : ��Ǩ�ͺ�Է�������� AA : Project �ͧ ��. ����
=E0=C3=D5=C2=B9=B7=D5=C1 ecosoft
=C1=D5=E0=A4=CA =BC=CD. =BD= =E8=D2=C2=E0=CB=E7=B9 AA =A2=CD=A7=E2=A4=C3=A7=A1=D2=C3=B7=D5=E8=B5=D1=C7= =E0=CD=A7=E4=C1=E8=E4=B4=E9=CD=C2=D9=E8=A4=C3=D1=BA
=A4=D8=B3=B4=C7=A7=E3=A8 =E0=BB=E7=B9 =BC=CD. =BD=E8=D2=C2=BE=D1=B2=B9=D2= =A1=D3=C5=D1=A7=A4=B9
=E0=CB=E7=B9 Project P670203 =E3= =B9=B0=D2=B9=D0 member ( =CD=D1=B9=B9=D5=E9=B6=D9=A1=E1=C5=E9=C7)
=E1=B5=E8=B5=E9=CD=A7=E4=C1=E8=E0=CB=E7= =B9 Project P670202 =E1=C5=D0 Project P670106
=E0=BE=C3=D2=D0 P670202 =CB=D1=C7=CB=B9= =E9=D2=E2=A4=C3=A7=A1=D2=C3=CD=C2=D9=E8=BD=E8=D2=C2=BA=C3=D4=A1=D2=C3=C7=D4=
Anyone face the same issue? And what can we do about it?
kittiu
April 17, 2024, 10:16am
2
I found the problem and propose the fix here,
frappe:develop
← kittiu:patch-3
opened 10:01AM - 17 Apr 24 UTC
When the sender is using email with windows-874 charset (i.e., Outlook / Thai), … the incoming email, i.e., to Issue will result in weird characters.
This is due to, python don't know about this charset. This fix by using alias charset for the problematic charset.
This is the initial problem when (1) if charset is windows-871, it will get LookupError and do nothing (2)
![image](https://github.com/frappe/frappe/assets/1973598/bb0bd5a6-4f4f-4a4e-97d5-c92026b26177)
Now, with the ALIAS charset, the windows-874 will be changed to cp874 which python knows about.
It is because the incoming email is using charset window-874 which python don’t know about. So, need to change to cp874 when do the decoding.