Tcl Library Source Code

View Ticket
Login
Ticket UUID: 759713c5c469c847a1b5820db3d6fe8418a98ceb
Title: Tcllib mime package doesn't (document) support for header encoding
Type: Bug Version: 8.5
Submitter: anonymous Created on: 2014-01-07 22:20:11
Subsystem: mime Assigned To: aku
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2014-05-09 02:56:37
Resolution: None Closed By: nobody
    Closed on:
Description:
There is no publicly documented way to provide a header in any other encoding than US ASCII. However the following code seems to work for Latin_1:

    set token [mime::initialize -string $emailContent -canonical text/plain -encoding quoted-printable -param {charset iso-8859-1}]
    set subject [::mime::word_encode utf-8 quoted-printable [encoding convertto utf-8 "ΓΆΓΆ"]]   
    # ... ie. subject set to two umlaut-o characters

This uses the undocumented ::mime::word command and setting other parameters accordingly. The desire here would likely be that sensible defaults would be given without the developer having to worry about matters, assuming strings are Tcl utf-8 strings.