/[qemacs]/qemacs/charset.c
ViewVC logotype

Diff of /qemacs/charset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by chqrlie, Wed May 11 15:12:14 2005 UTC revision 1.5 by chqrlie, Fri Jul 8 09:30:44 2005 UTC
# Line 20  Line 20 
20    
21  QECharset *first_charset = NULL;  QECharset *first_charset = NULL;
22    
23  extern QECharset charset_7bit;  static QECharset charset_7bit;
24    
25  /* specific tables */  /* specific tables */
26  static unsigned short table_idem[256];  static unsigned short table_idem[256];
# Line 171  int utf8_decode(const char **pp) Line 171  int utf8_decode(const char **pp)
171      const unsigned char *p;      const unsigned char *p;
172      int i, l;      int i, l;
173    
174      p = *pp;      p = *(const unsigned char**)pp;
175      c = *p++;      c = *p++;
176      if (c < 128) {      if (c < 128) {
177          /* fast case for ASCII */          /* fast case for ASCII */
# Line 194  int utf8_decode(const char **pp) Line 194  int utf8_decode(const char **pp)
194                  c == 0xfffe || c == 0xffff)                  c == 0xfffe || c == 0xffff)
195              goto fail;              goto fail;
196      }      }
197      *pp = p;      *(const unsigned char**)pp = p;
198      return c;      return c;
199   fail:   fail:
200      *pp = p;      *(const unsigned char**)pp = p;
201      return INVALID_CHAR;      return INVALID_CHAR;
202  }  }
203    
# Line 270  static int decode_utf8_func(CharsetDecod Line 270  static int decode_utf8_func(CharsetDecod
270    
271  unsigned char *encode_utf8(QECharset *charset, unsigned char *q, int c)  unsigned char *encode_utf8(QECharset *charset, unsigned char *q, int c)
272  {  {
273      return utf8_encode(q, c);      return (unsigned char*)utf8_encode((char*)q, c);
274  }  }
275    
276  static const char *aliases_utf_8[] = { "utf8", NULL };  static const char *aliases_utf_8[] = { "utf8", NULL };
# Line 368  int unicode_to_charset(char *buf, unsign Line 368  int unicode_to_charset(char *buf, unsign
368  {  {
369      char *q;      char *q;
370    
371      q = charset->encode_func(charset, buf, c);      q = (char *)charset->encode_func(charset, (unsigned char*)buf, c);
372      if (!q) {      if (!q) {
373          q = buf;          q = buf;
374          *q++ ='?';          *q++ ='?';

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26