~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to pith/charset.c

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2008-09-23 12:17:56 UTC
  • mfrom: (2.1.8 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080923121756-6u4x8bwq89qlzt32
Tags: 2.00+dfsg-2
Update to package description: note that Alpine is no longer in
alpha. (Closes: #499640)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#if !defined(lint) && !defined(DOS)
2
 
static char rcsid[] = "$Id: charset.c 875 2007-12-17 18:39:47Z hubert@u.washington.edu $";
 
2
static char rcsid[] = "$Id: charset.c 1031 2008-04-10 23:43:03Z hubert@u.washington.edu $";
3
3
#endif
4
4
 
5
5
/*
6
6
 * ========================================================================
7
 
 * Copyright 2006-2007 University of Washington
 
7
 * Copyright 2006-2008 University of Washington
8
8
 *
9
9
 * Licensed under the Apache License, Version 2.0 (the "License");
10
10
 * you may not use this file except in compliance with the License.
20
20
#include "../pith/state.h"
21
21
#include "../pith/conf.h"
22
22
#include "../pith/escapes.h"
23
 
#include "../pith/rfc2231.h"
 
23
#include "../pith/mimedesc.h"
24
24
#include "../pith/filter.h"
25
25
#include "../pith/string.h"
26
26
#include "../pith/options.h"
48
48
 
49
49
 
50
50
    if((body = mail_body(stream, msgno, section)) && body->type == TYPETEXT){
51
 
        if(!(charset = rfc2231_get_param(body->parameter, "charset", NULL, NULL)))
 
51
        if(!(charset = parameter_val(body->parameter, "charset")))
52
52
          charset = cpystr("US-ASCII");
53
53
 
54
54
        return(charset);
459
459
                }
460
460
            }
461
461
        }
 
462
        else if((cset=ps_global->VAR_UNK_CHAR_SET)
 
463
                && strucmp((char *) cset, "us-ascii")
 
464
                && strucmp((char *) cset, "utf-8")
 
465
                && utf8_charset(cset)){
 
466
                if(!utf8_text(&src, cset, &xsrc, 0L)){
 
467
                    /* should not happen */
 
468
                    panic("c-client failed to transliterate recognized character set");
 
469
                }
 
470
        }
462
471
        else{
463
472
            /* unknown bytes - mask off high bit chars */
464
473
            for(i = 0; i < l; i++)