Show
Ignore:
Timestamp:
2000-05-09 08:19:26 (9 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Edmund Grimley Evans' UTF-8 patch.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • charset.h

    r1625 r1716  
    2020#define _CHARSET_H 
    2121 
    22 typedef int CHARSET_MAP[256]; 
    23  
    24 typedef struct descr 
    25 { 
    26   char *symbol; 
    27   int repr; 
    28 } 
    29 CHARDESC; 
    30  
    31 typedef struct 
    32 { 
    33   char *charset; 
    34   char escape_char; 
    35   char comment_char; 
    36   short multbyte; 
    37   LIST *aliases; 
    38 } 
    39 CHARMAP; 
    40  
    41 typedef struct 
    42 { 
    43   size_t n_symb; 
    44   size_t u_symb; 
    45  
    46   short multbyte; 
    47   HASH *symb_to_repr; 
    48   CHARDESC **description; 
    49 } 
    50 CHARSET; 
     22#include <iconv.h> 
    5123 
    5224#define DECODER_BUFFSIZE 4096 
     
    6032typedef struct decoder 
    6133{ 
    62   short src_is_utf8; 
     34  /*short src_is_utf8;*/ 
    6335  short just_take_id; 
    6436  short forced; 
    65    
    66   /* used for utf-8 decoding */ 
    67   CHARSET *chs; 
     37  char *outrepl; 
    6838 
    69   /* used for 8-bit to 8-bit recoding */ 
    70   CHARSET_MAP *chm; 
    71    
     39  /* conversion descriptor */ 
     40  iconv_t cd; 
     41 
    7242  /* the buffers */ 
    7343  struct decoder_buff in; 
     
    8454int mutt_decoder_push_one (DECODER *, char); 
    8555 
    86 CHARSET *mutt_get_charset(const char *); 
    87 CHARSET_MAP *mutt_get_translation(const char *, const char *); 
    88 int mutt_display_string(char *, CHARSET_MAP *); 
    89 int mutt_is_utf8(const char *); 
    9056int mutt_recode_file (const char *, const char *, const char *); 
    91 unsigned char mutt_display_char(unsigned char, CHARSET_MAP *); 
    92 void mutt_decode_utf8_string(char *, CHARSET *); 
     57 
     58int mutt_convert_string (char *, size_t, const char *, const char *); 
     59 
     60size_t mutt_iconv (iconv_t, const char **, size_t *, char **, size_t *, const char **, const char *); 
     61 
     62typedef void * FGETCONV; 
     63 
     64FGETCONV *fgetconv_open (FILE *, const char *, const char *); 
     65int fgetconv (FGETCONV *); 
     66void fgetconv_close (FGETCONV *); 
    9367 
    9468#endif /* _CHARSET_H */