Roxen.git / server / modules / tags / email.pike

version» Context lines:

Roxen.git/server/modules/tags/email.pike:1:   // This is a roxen module. Copyright © 2000 - 2009, Roxen IS.      // Todo:   // - Docs   // - more debug coloring :)      #define EMAIL_LABEL "Email: "    - constant cvs_version = "$Id: email.pike,v 1.52 2011/01/21 08:46:30 jonasw Exp $"; + constant cvs_version = "$Id$";      constant thread_safe=1;      #include <module.h>   inherit "module";      // ------------------------ Setting the defaults -------------------------      void create(Configuration conf)   {
Roxen.git/server/modules/tags/email.pike:263:    lambda(string el1) {    return (replace(el1, "\n", "\r\n"));    })    )*"\r\n";    }       content_type = ftype + (aname ? "; name=\""+aname+"\"" : "");    content_disp = ((args->disposition || "attachment") +    (aname ? "; filename=\""+aname+"\"" : ""));    +  // Decide on suitable charset. If data is wide string we use UTF-8, +  // otherwise nothing. +  if (String.width(body) > 8) { +  content_type += "; charset=utf-8"; +  body = string_to_utf8(body); +  } +     // Use "nocid" for first attachment (backwards compatibility)    // but counter-based strings for subsequent attachments.    if (args->cid)    content_id = args->cid;    else {    int nocid_counter = id->misc["_email_nocid_"]++;    content_id =    nocid_counter ? sprintf("cid_%05d", nocid_counter) : "nocid";    }   
Roxen.git/server/modules/tags/email.pike:474:    )*"\r\n";       // charset    chs = args->charset || id->misc->input_charset || query("CI_charset");    //if(!stringp(chs) || !sizeof(chs))    // id->misc->input_charset;       // UTF8 -> dest. charset    if(sizeof(chs))    { -  object /* Locate.Charset.encoder */ enc; -  if (mixed err = catch (enc = Locale.Charset.encoder (chs))) +  Charset.Encoder enc; +  if (mixed err = catch (enc = Charset.encoder (chs)))    if (has_prefix (describe_error (err), "Unknown character encoding"))    parse_error ("Unknown charset %O.\n", chs);    else    throw (err);       // Subject    // Only encode the subject if it contains non us-ascii (7-bit) characters.    if (String.width(subject) != 8 || string_to_utf8(subject) != subject)    {    string s_chs = chs;