Support for GB2312 encoding

Hi,

Could you guys add support for gb2312 encoding? As gb2312 is used by China and it’d be great to see zammad support this encoding for their Asian users.

I really appreciate all contributors and developers devoting their time on such amazing ticket system.

Thanks!

veritaspoitine

I hope I am not the only person needing this feature.

Email encode support GB2312? Can you tell me more?

@never

We are dealing with many customers from China and it seems that GB2312 is a popular encoding scheme over there. As the result, whenever we receive an email originate from China zammad would fail display the content properly.

Screenshots for reference:


OK, I got your issue. Let me do more testing.

@never thanks for your contributions!

@veritaspoutine, I can’t reproduce your issue on 2.7, here is my .eml file, can you import your system for test OR post your .eml file in here?

cat /tmp/ticket-67077-145.eml | rails r 'Channel::Driver::MailStdin.new'

My .eml file:

Received: from m12-16.163.com (unknown [9.8.7.6])
	by bizmx13.qq.com (NewMx) with SMTP id 
	for <test@example.org>; Thu, 18 Oct 2018 14:28:08 +0800
X-QQ-FEAT: Xcj/CY6QL7jJ5uZoTNyq06x2ovJM6j16bvVwezFr+jLgIpMXQ2auCe/BB9oTa
	I8A5YD+rnfM+tNoS66fAOjZeQvZK3/pyE2WcKIdsx0cZURK6NST/yeEboWDKxOb4AlE+KxR
	hn89OSu19C7Alwfr3PCfFI5OMfetU6lkhSfzp06tn0BXeZ0c2Mn7b8fYbEhK856qVHnfEFU
	vYqV93oIFZ3VcLg+07xVpliFn4+16GyMpR/rrU9jkEJL7WU0anEZHVkhjAhX8wUA3XJUfiX
	94mjuUsLoeCEipETZuoViEqLo=
X-QQ-MAILINFO: MJpDEouUnwTTaYWZH9rKa1YsVE5YffwH+JrObAbdfO6ro1Ncv1kpPFMJy
	Md7SYxCO+MFary7pw2CmNsEYzVg5b6ygYApZVx/AZA8qpgqHsnNRBqwr9d5rOC3r1D7ioO9
	8iSzyaqZSDfUZTq9VO4my6w=
X-QQ-mid: bizmx13t1539844089t7o0uhl88
X-QQ-ORGSender: zammad@example.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
	s=s110527; h=Date:From:Subject:Mime-Version:Message-ID; bh=ujEvQ
	Wd3rNiiorn3pn30xbjvxmRN+RetKkqWDykV9M8=; b=HyjPh9VtTYOOBQ1XsgYwS
	7RsBnx5m9qkWFaQdChLz+h76bzYPNABho2BOxu7cPZi3EoKbTjL4ZbCJFfcVDa/h
	rz9cfK1bn4aMynlzBhzr+eCzDz9LmleZwiAt2a1f8jxjdomqMqRFF9+12ylJ1Fis
	8faiGT/Ym10bR4uVCdjfIQ=
Received: from never-PC (unknown [1.2.3.4])
	by smtp12 (Coremail) with SMTP id EMCowADHKSD2J8hbzo3uJg--.60052S2;
	Thu, 18 Oct 2018 14:28:07 +0800 (CST)
Date: Thu, 18 Oct 2018 14:28:04 +0800
From: "zammad@example.com" <zammad@example.com>
To: test <test@example.org>
Subject: =?gb2312?B?R29vZ2xlIMrNs/bByyBDaHJvbWUgNzA=?=
X-Priority: 3
X-GUID: 21FE08AD-D9F0-46C1-AEF2-229409B0672B
X-Has-Attach: no
X-Mailer: Foxmail 7, 2, 7, 164[cn]
Mime-Version: 1.0
Message-ID: <201810181426858673981@163.com>
Content-Type: multipart/alternative;
	boundary="----=_001_NextPart672037122823_=----"
X-CM-TRANSID:EMCowADHKSD2J8hbzo3uJg--.60052S2
X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73
	VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUTEfOUUUUU
X-Originating-IP: [1.2.3.4]
X-CM-SenderInfo: 52dpztrg6rljoofrz/xtbBEhfj9lZX+RvdIgAAsM

This is a multi-part message in MIME format.

------=_001_NextPart672037122823_=----
Content-Type: text/plain;
	charset="gb2312"
Content-Transfer-Encoding: base64

R29vZ2xlIMrNs/bByyBDaHJvbWUgNzCjrNb30qqx5LuvsPzAqKO60MK1xMno1sPD5rDl0aHP7qOs
1MrQ7dPDu6e199X7IENocm9tZSA2OSDS/cjrtcS1x8K8t73KvaO71qez1iBUTFMgMS4zo7u4/NDC
IFdlYiBBdXRoZW50aWNhdGlvbiBBUEmju9ans9bQwrXEIEFWMSDK08a1seC94sLrxveju1NoYXBl
IERldGVjdGlvbiBBUEmjrLXItcihow0KDQoNCg0KemFtbWFkQDE2My5jb20NCg==

------=_001_NextPart672037122823_=----
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charse=
t=3Dgb2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; fon=
t-family: =D0=C2=BC=9A=C3=F7=F3w; color: rgb(0, 0, 0); line-height: 1.5; }=
body { font-size: 10.5pt; font-family: =D0=C2=BC=9A=C3=F7=F3w; color: rgb(=
0, 0, 0); line-height: 1.5; }</style></head><body>=0A<div><span></span><sp=
an style=3D"color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">Goog=
le&nbsp;=CA=CD=B3=F6=C1=CB&nbsp;Chrome&nbsp;70=A3=AC=D6=F7=D2=AA=B1=E4=BB=
=AF=B0=FC=C0=A8=A3=BA=D0=C2=B5=C4=C9=E8=D6=C3=C3=E6=B0=E5=D1=A1=CF=EE=A3=
=AC=D4=CA=D0=ED=D3=C3=BB=A7=B5=F7=D5=FB&nbsp;Chrome&nbsp;69&nbsp;=D2=FD=C8=
=EB=B5=C4=B5=C7=C2=BC=B7=BD=CA=BD=A3=BB=D6=A7=B3=D6&nbsp;TLS&nbsp;1.3=A3=
=BB=B8=FC=D0=C2&nbsp;Web&nbsp;Authentication&nbsp;API=A3=BB=D6=A7=B3=D6=D0=
=C2=B5=C4&nbsp;AV1&nbsp;=CA=D3=C6=B5=B1=E0=BD=E2=C2=EB=C6=F7=A3=BBShape&nb=
sp;Detection&nbsp;API=A3=AC=B5=C8=B5=C8=A1=A3</span></div>=0A<div><br></di=
v><hr style=3D"width: 210px; height: 1px;" color=3D"#b5c4df" size=3D"1" al=
ign=3D"left">=0A<div><span><div style=3D"MARGIN: 10px; FONT-FAMILY: verdan=
a; FONT-SIZE: 10pt"><div>zammad@163.com</div></div></span></div>=0A</body>=
</html>
------=_001_NextPart672037122823_=------




Edited: copy .eml code and paste in text editor save as ticket-67077-145.eml

@never

Is GB2312 supported in version 2.7? My zammad is currently on 2.5. Does 2.6 support it as well?

Yes, 2.6.0 supported.

I just upgraded my zammad to 2.6. It seems that tickets migrated from previous version will continue to suffer from gb2312 encoding issue. But if the same email is downloaded in raw format and be resend again then no more encoding issue.

I am wondering if ticket encoding issue from 2.5 and below version won’t get fixed in a newer version even after upgrading to 2.6?

Right, as you say.

User(1) -> email(2) -> postmaster(3) -> encoding(4) -> Ticket(5)
fixed in (4), you are in (5)

@never thanks for your help man!

This topic was automatically closed after 416 days. New replies are no longer allowed.