Manually decoding an encoded email subject. 2022-07-12. UTF-8. Spam email's subject field: =?GB2312?B?tPq/qreixrExMzUxMDg3NjUyMw==?= Subject is Encoded-Word -encoded. (https://en.wikipedia.org/wiki/MIME#Encoded-Word) Form: =? charset ? encoding ? encoded text ?= Splitting into parts: Charset: GB2312 Encoding: B Encoded text: tPq/qreixrExMzUxMDg3NjUyMw== An encoding of 'Q' is similar to quoted-printable, while an encoding of 'B' is base-64. Decoding the base64, using the command line $ base64 --decode | xxd tPq/qreixrExMzUxMDg3NjUyMw== ^D 00000000: b4fa bfaa b7a2 c6b1 3133 3531 3038 3736 ........13510876 00000010: 3532 33 523 GB2312 (https://en.wikipedia.org/wiki/GB_2312), or EUC-CN, is a variable-character, but at most two-byte, encoding: a byte less than 0x80 is the actual ASCII character. The actual Chinese-encoding characters are all two bytes in the range 0xA1 to 0xFE. We use the charts at https://en.wikipedia.org/wiki/GB_2312#Code_charts to manually decode this. Character data, hexadecimal: B4FA BFAA B7A2 C6B1 31 33 35 31 30 38 37 36 35 32 33. The single bytes that start with a '3' are all ASCII numbers: they make up the string "13510876523", presumably a QQ or WeChat number. The other four characters are B4FA: row 20, column 90: 代 U+4EE3 BFAA: row 31, column 10: 开 U+5F00 B7A2: row 23, column 02: 发 U+53D1 C6B1: row 38, column 17: 票 U+7968 (\u4EE3\u5F00\u53D1\u7968) 代开发票: "dài kāi fāpiào", 'invoice on behalf of'. The full subject line therefore translates to "Invoice on behalf of 13510876523". It's a scam, they send a malware-ridden file that appears to be the invoice.