utf8.h | utf8.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
* | * | |||
* Author: Mark Crispin | * Author: Mark Crispin | |||
* Networks and Distributed Computing | * Networks and Distributed Computing | |||
* Computing & Communications | * Computing & Communications | |||
* University of Washington | * University of Washington | |||
* Administration Building, AG-44 | * Administration Building, AG-44 | |||
* Seattle, WA 98195 | * Seattle, WA 98195 | |||
* Internet: MRC@CAC.Washington.EDU | * Internet: MRC@CAC.Washington.EDU | |||
* | * | |||
* Date: 11 June 1997 | * Date: 11 June 1997 | |||
* Last Edited: 30 August 2006 | * Last Edited: 21 September 2006 | |||
*/ | */ | |||
/* UTF-8 size and conversion routines from UCS-2 values (thus in the BMP). | /* UTF-8 size and conversion routines from UCS-2 values (thus in the BMP). | |||
* Don't use these if UTF-16 data (surrogate pairs) are an issue. | * Don't use these if UTF-16 data (surrogate pairs) are an issue. | |||
* For UCS-4 values, use the utf8_size() and utf8_put() functions. | * For UCS-4 values, use the utf8_size() and utf8_put() functions. | |||
*/ | */ | |||
#define UTF8_SIZE_BMP(c) ((c & 0xff80) ? ((c & 0xf800) ? 3 : 2) : 1) | #define UTF8_SIZE_BMP(c) ((c & 0xff80) ? ((c & 0xf800) ? 3 : 2) : 1) | |||
#define UTF8_PUT_BMP(b,c) { \ | #define UTF8_PUT_BMP(b,c) { \ | |||
if (c & 0xff80) { /* non-ASCII? */ \ | if (c & 0xff80) { /* non-ASCII? */ \ | |||
skipping to change at line 485 | skipping to change at line 485 | |||
ucs4cn_t cv,ucs4de_t de); | ucs4cn_t cv,ucs4de_t de); | |||
long utf8_cstext (SIZEDTEXT *text,char *charset,SIZEDTEXT *ret, | long utf8_cstext (SIZEDTEXT *text,char *charset,SIZEDTEXT *ret, | |||
unsigned long errch); | unsigned long errch); | |||
long utf8_cstocstext (SIZEDTEXT *text,char *sc,SIZEDTEXT *ret,char *dc, | long utf8_cstocstext (SIZEDTEXT *text,char *sc,SIZEDTEXT *ret,char *dc, | |||
unsigned long errch); | unsigned long errch); | |||
unsigned short *utf8_rmap (char *charset); | unsigned short *utf8_rmap (char *charset); | |||
unsigned short *utf8_rmap_cs (const CHARSET *cs); | unsigned short *utf8_rmap_cs (const CHARSET *cs); | |||
unsigned short *utf8_rmap_gen (const CHARSET *cs,unsigned short *oldmap); | unsigned short *utf8_rmap_gen (const CHARSET *cs,unsigned short *oldmap); | |||
long utf8_rmaptext (SIZEDTEXT *text,unsigned short *rmap,SIZEDTEXT *ret, | long utf8_rmaptext (SIZEDTEXT *text,unsigned short *rmap,SIZEDTEXT *ret, | |||
unsigned long errch,long iso2022jp); | unsigned long errch,long iso2022jp); | |||
unsigned long utf8_rmapsize (SIZEDTEXT *text,unsigned short *rmap, | ||||
unsigned long errch,long iso2022jp); | ||||
long ucs4_rmaptext (unsigned long *ucs4,unsigned long len,unsigned short *r map, | long ucs4_rmaptext (unsigned long *ucs4,unsigned long len,unsigned short *r map, | |||
SIZEDTEXT *ret,unsigned long errch); | SIZEDTEXT *ret,unsigned long errch); | |||
long ucs4_rmaplen (unsigned long *ucs4,unsigned long len,unsigned short *rm ap, | long ucs4_rmaplen (unsigned long *ucs4,unsigned long len,unsigned short *rm ap, | |||
unsigned long errch); | unsigned long errch); | |||
long ucs4_rmapbuf (unsigned char *t,unsigned long *ucs4,unsigned long len, | long ucs4_rmapbuf (unsigned char *t,unsigned long *ucs4,unsigned long len, | |||
unsigned short *rmap,unsigned long errch); | unsigned short *rmap,unsigned long errch); | |||
unsigned long utf8_get (unsigned char **s,unsigned long *i); | unsigned long utf8_get (unsigned char **s,unsigned long *i); | |||
unsigned long ucs4_cs_get (CHARSET *cs,unsigned char **s,unsigned long *i); | unsigned long ucs4_cs_get (CHARSET *cs,unsigned char **s,unsigned long *i); | |||
const CHARSET *utf8_infercharset (SIZEDTEXT *src); | const CHARSET *utf8_infercharset (SIZEDTEXT *src); | |||
long utf8_validate (unsigned char *s,unsigned long i); | long utf8_validate (unsigned char *s,unsigned long i); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||