[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smtpmail support of unicode passwords

From: Eli Zaretskii
Subject: Re: smtpmail support of unicode passwords
Date: Mon, 14 Apr 2014 15:27:46 +0300

> From: "Stephen J. Turnbull" <address@hidden>
> Cc: Stefan Monnier <address@hidden>,
>     address@hidden,
>     address@hidden
> Date: Mon, 14 Apr 2014 21:14:50 +0900
> Eli Zaretskii writes:
>  > My reading if the relevant RFCs is that UTF-8 must be used, but I'm no
>  > expert in this area.
> By relevant RFCs I assume you mean RFC 4616 (aka SASL "PLAIN")?


> Indeed, the receiving server is going to expect that the string is
> valid UTF-8.  That doesn't necessarily mean that Emacs has the string
> as characters in internal encoding, appropriate to be encoded via the
> utf-8 coding system before being sent on the wire.  It might also have
> it as bytes read from a file using the binary codec (the main use case
> I'm worried about), or the user may have learned to type it that way,
> etc.

If a unibyte string gets to that place, it's a separate bug that needs
to be fixed separately.  As a matter of principle, any human-readable
text read into Emacs should be decoded, rather than left as raw bytes.

When the user types anything, Emacs decodes input before storing it in
buffers or strings.  And if the password is produced by a function,
that function should make sure it produces a decoded multibyte string.

So yes, I think we want to depend on having multibyte strings there.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]