1 @node Working with Multilingual Text
2 @chapter Working with Multilingual Text
4 @node Guile Character Properties, Exchanging Text With The Outside World, Multibyte String Functions, Functions for Operating on Multibyte Text
5 @section Guile Character Properties
7 These functions give information about the nature of a given Guile
8 character. These are defined for any @code{scm_mb_char_t} value.
10 @deftypefn {Libguile Function} int scm_mb_isalnum (scm_mb_char_t @var{c})
11 Return non-zero iff @var{c} is an alphabetic or numeric character.
14 @deftypefn {Libguile Function} int scm_mb_is_alpha (scm_mb_char_t @var{c})
15 Return non-zero iff @var{c} is an alphabetic character.
18 @deftypefn {Libguile Function} int scm_mb_iscntrl (scm_mb_char_t @var{c})
19 Return non-zero iff @var{c} is a control character.
22 @deftypefn {Libguile Function} int scm_mb_isdigit (scm_mb_char_t @var{c})
23 Return non-zero iff @var{c} is a digit.
26 @deftypefn {Libguile Function} int scm_mb_isgraph (scm_mb_char_t @var{c})
27 Return non-zero iff @var{c} is a visible character.
30 @deftypefn {Libguile Function} int scm_mb_isupper (scm_mb_char_t @var{c})
31 Return non-zero iff @var{c} is an upper-case character.
34 @deftypefn {Libguile Function} int scm_mb_islower (scm_mb_char_t @var{c})
35 Return non-zero iff @var{c} is a lower-case character.
38 @deftypefn {Libguile Function} int scm_mb_istitle (scm_mb_char_t @var{c})
39 Return non-zero iff @var{c} is a title-case character. See the Unicode
40 standard for an explanation of title case.
43 @deftypefn {Libguile Function} int scm_mb_isprint (scm_mb_char_t @var{c})
44 Return non-zero iff @var{c} is a printable character.
47 @deftypefn {Libguile Function} int scm_mb_ispunct (scm_mb_char_t @var{c})
48 Return non-zero iff @var{c} is a punctuation character.
51 @deftypefn {Libguile Function} int scm_mb_isspace (scm_mb_char_t @var{c})
52 Return non-zero iff @var{c} is a whitespace character.
55 @deftypefn {Libguile Function} int scm_mb_isxdigit (scm_mb_char_t @var{c})
56 Return non-zero iff @var{c} is a hexadecimal digit.
59 @deftypefn {Libguile Function} int scm_mb_isdefined (scm_mb_char_t @var{c})
60 Return non-zero iff @var{c} is a valid character.
63 @deftypefn {Libguile Function} scm_mb_char_t scm_mb_char_toupper (scm_mb_char_t @var{c})
64 @deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_tolower (scm_mb_char_t @var{c})
65 @deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_totitle (scm_mb_char_t @var{c})
66 Convert @var{c} to upper, lower, or title case. If @var{c} has no
67 equivalent in the requested case, or is already in that case, return it
71 @deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
72 If @var{c} is a hexadecimal digit (according to
73 @code{scm_mb_isxdigit}), then return its numeric value. Otherwise
77 @deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
78 If @var{c} is a digit (according to @code{scm_mb_isdigit}), then
79 return its numeric value. Otherwise return -1.
83 @node Multibyte Character Tables, Multibyte Character Categories, Exchanging Text With The Outside World, Functions for Operating on Multibyte Text
84 @section Multibyte Character Tables
86 A @dfn{character table} is a table mapping @code{scm_mb_char_t} values
87 onto Guile objects. Guile provides functions for creating character
88 tables, setting entries, and looking up characters. Character tables
89 are Guile objects, so they are managed by Guile's garbage collector.
91 A character table can have a ``parent'' table, from which it inherits
92 values for characters. If a character table @var{child}, with a parent
93 table @var{parent} maps some character @var{c} to the value
94 @code{SCM_UNDEFINED}, then @code{scm_c_char_table_ref (@var{child},
95 @var{c})} will look up @var{c} in @var{parent}, and return the value it
98 This section describes only the C API for working with character tables.
99 For the Scheme-level API, see @ref{some other section}.
101 @deftypefn {Libguile Function} scm_make_char_table (SCM @var{init}, SCM @var{parent})
102 Return a new character table object which maps every character to
103 @var{init}. If @var{parent} is a character table, then @var{parent} is
104 the new table's parent. If @var{parent} table is @code{SCM_UNDEFINED},
105 then the new table has no parent. Otherwise, signal a type error.
108 @deftypefn {Libguile Function} SCM scm_c_char_table_ref (SCM @var{table}, scm_mb_char_t @var{c})
109 Look up the character @var{c} in the character table @var{table}, and
110 return the value found there. If @var{table} maps @var{c} to
111 @code{SCM_UNDEFINED}, and @var{table} has a parent, then look up @var{c}
114 If @var{table} is not a character table, signal an error.
117 @deftypefn {Libguile Function} SCM scm_c_char_table_set_x (SCM @var{table}, scm_mb_char_t @var{c}, SCM @var{value})
118 Set @var{table}'s value for the character @var{c} to @var{value}.
119 If @var{value} is @code{SCM_UNDEFINED}, then @var{table}'s parent's
120 value will show through for @var{c}.
122 If @var{table} is not a character table, signal an error.
124 This function changes only @var{table} itself, never @var{table}'s
128 [[this is all wrong. what about default values?]]
134 @node Multibyte Character Categories, , Multibyte Character Tables, Functions for Operating on Multibyte Text
135 @section Multibyte Character Categories
137 [[This will describe an ADT representing subsets of the Guile character
143 @node Exchanging Guile Text With the Outside World
144 @subsection Exchanging Guile Text With the Outside World
146 [[Scheme-level functions for converting between encodings]]