Skip to content

UTF-8 double-encoding in From header display name #254

@Hawkm6

Description

@Hawkm6

Description

When sending an email via gog gmail send --from, the display name from the Gmail send-as alias gets double-encoded in the From header if it contains non-ASCII characters.

Steps to Reproduce

  1. Have a send-as alias with a display name containing UTF-8 characters, e.g. Sérgio Bastos • Importrust
  2. Send an email:
gog gmail send \
  --account user@gmail.com \
  --from alias@domain.com \
  --to recipient@example.com \
  --subject "Test" \
  --body "Test email"

Expected

From header displays: Sérgio Bastos • Importrust <alias@domain.com>

Actual

From header displays: Sérgio Bastos • Importrust <alias@domain.com>

This is a classic UTF-8 double-encoding issue - the bytes of the UTF-8 string are being interpreted as Latin-1/ISO-8859-1 and then re-encoded as UTF-8.

Environment

  • gogcli version: v0.10.0
  • OS: macOS (Darwin, arm64)

Workaround

Changing the display name to ASCII-only characters via gog gmail sendas update is not viable as it requires domain-wide delegation (service account), returning a 403 error for regular OAuth tokens.

Currently there is no workaround other than changing the display name in Gmail web to remove non-ASCII characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions