2002-01-29 01:33:41 +00:00
|
|
|
#ifndef __UTF8_H
|
|
|
|
|
#define __UTF8_H
|
|
|
|
|
|
2003-10-19 19:09:51 +00:00
|
|
|
/* XXX I didn't check the encoding range of big5+. This is standard big5. */
|
|
|
|
|
#define is_big5_los(lo) (0x40 <= (lo) && (lo) <= 0x7E) /* standard */
|
|
|
|
|
#define is_big5_lox(lo) (0x80 <= (lo) && (lo) <= 0xFE) /* extended */
|
|
|
|
|
#define is_big5_lo(lo) ((is_big5_los(lo) || is_big5_lox(lo)))
|
|
|
|
|
#define is_big5_hi(hi) (0x81 <= (hi) && (hi) <= 0xFE)
|
|
|
|
|
#define is_big5(hi,lo) (is_big5_hi(hi) && is_big5_lo(lo))
|
|
|
|
|
|
2016-05-13 01:26:33 +02:00
|
|
|
#include <glib.h>
|
|
|
|
|
typedef guint32 unichar;
|
|
|
|
|
|
2002-10-14 18:33:29 +00:00
|
|
|
/* Returns width for character (0-2). */
|
2007-05-25 21:56:30 +00:00
|
|
|
int mk_wcwidth(unichar c);
|
2002-10-14 18:33:29 +00:00
|
|
|
|
2016-05-13 01:39:14 +02:00
|
|
|
/* Advance the str pointer one character further; return the number of columns
|
|
|
|
|
* occupied by the skipped character.
|
|
|
|
|
*/
|
2016-05-13 01:52:37 +02:00
|
|
|
int string_advance(char const **str, gboolean utf8);
|
2016-05-13 01:39:14 +02:00
|
|
|
|
2007-05-31 13:19:05 +00:00
|
|
|
#define unichar_isprint(c) (((c) & ~0x80) >= 32)
|
2014-01-08 15:03:25 +01:00
|
|
|
#define is_utf8_leading(c) (((c) & 0xc0) != 0x80)
|
2007-05-31 13:19:05 +00:00
|
|
|
|
2002-01-29 01:33:41 +00:00
|
|
|
#endif
|