[cl-smtp-devel] Encoding issues

Hans Hübner hans at huebner.org
Tue Jul 29 21:21:21 UTC 2008


Hi Leslie,

I cannot really help much with CL-SMTP:SEND-SMTP as I am not using it
myself and don't understand the code quite well.  I use
CL-SMTP:WITH-SMTP-MAIL and CL-MIME for my mail composition purposes,
which gives me more control over the format and encoding of the email.

That said, some general comments:  All non-ASCII characters in email
headers are automatically encoded using quoted printable encoding.  In
bodies, no such automatic conversion is performed.

Have a look at http://bknr.net/trac/browser/trunk/projects/bos/m2/mail-generator.lisp#L53,
which is the mail sending routine in one of my projects.  It works
with non-ASCII characters.  You may be able to adopt it for your
purposes.

Good luck,
Hans

On Tue, Jul 29, 2008 at 23:02, Leslie P. Polzer <leslie.polzer at gmx.net> wrote:
>
> Hi,
>
> I'm having trouble getting my German umlauts and other
> special characters across the SMTP pipe.
>
> Without any effort by me, some parts get annotated inline:
>
>  Sei gegrüßt -> Sei gegr=?ISO-8859-15?Q?=FC=DFt
>
> and some vanish completely:
>
>  benötigt -> bentigt
>
> I tried converting my UTF8 strings to latin1 via flexi-streams
> and Babel:
>
>  (babel:octets-to-string
>    (babel:string-to-octets
>      "Sei gegrüßt, benötigt"
>      :encoding :utf-8)
>    :encoding :latin-1)
>
> -> "Sei gegrüßt, benötigt"
>
> but CL-SMTP refuses the body with:
>
>  debugger invoked on a FLEXI-STREAMS:FLEXI-STREAM-ENCODING-ERROR
>    in thread #<THREAD "initial thread" {A72A5D9}>:
>  #\VULGAR_FRACTION_ONE_QUARTER is not in this encoding.
>
> Partial backtrace:
>
> 0: (FLEXI-STREAMS::SIGNAL-ENCODING-ERROR
>    #<FLEXI-STREAMS::FLEXI-8-BIT-OUTPUT-STREAM {B35E001}>
>    "~S is not in this encoding.")
> 1: ((SB-PCL::FAST-METHOD FLEXI-STREAMS::CHAR-TO-OCTETS
>     (FLEXI-STREAMS::FLEXI-8-BIT-OUTPUT-STREAM T T))
>    #<unavailable argument>
>    #<unavailable argument>
>    #<unavailable argument>
>    #<unavailable argument>
>    #<unavailable argument>)
> 2: ((SB-PCL::FAST-METHOD TRIVIAL-GRAY-STREAMS:STREAM-WRITE-SEQUENCE
>     (FLEXI-STREAMS:FLEXI-OUTPUT-STREAM STRING T T))
>    #<unavailable argument>
>    #<unavailable argument>
>    #<unavailable argument>
>    #<unavailable argument>
>    #<unavailable argument>
>    #<unavailable argument>)
> 3: (WRITE-STRING
>    "¼"
>    #<FLEXI-STREAMS::FLEXI-8-BIT-OUTPUT-STREAM {B35E001}>
>    :START
>    0
>    :END
>    NIL)
> 4: (FLEXI-STREAMS:STRING-TO-OCTETS #<unavailable argument>)
> 5: ((SB-PCL::FAST-METHOD SB-GRAY:STREAM-WRITE-CHAR [...]
>
> Also, latin1 seems to be hard-coded at a bunch of locations
> in CL-SMTP.
>
> I'm using Hans' BKNR version of CL-SMTP and would
> appreciate any help.
>
>  Cheers,
>
>    Leslie
>
> --
> LinkedIn Profile: http://www.linkedin.com/in/polzer
> Blog: http://blog.viridian-project.de/
>
> _______________________________________________
> cl-smtp-devel mailing list
> cl-smtp-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-smtp-devel
>



More information about the cl-smtp-devel mailing list