summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-06-30 10:53:52 +0200
committerBruno Haible <bruno@clisp.org>2009-06-30 10:53:52 +0200
commita2db16e8e2a0a34c998178f9c1efd720e4cfdee9 (patch)
tree25895cf07fc8cba8a1522a6b6f02ef948fb33ff0 /doc
parent116c15a81610cdeab05883d1a8e5149c1964ab20 (diff)
downloadlibunistring-a2db16e8e2a0a34c998178f9c1efd720e4cfdee9.tar.gz
Add an example.
Diffstat (limited to 'doc')
-rw-r--r--doc/unicase.texi14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/unicase.texi b/doc/unicase.texi
index 89df977..14b46be 100644
--- a/doc/unicase.texi
+++ b/doc/unicase.texi
@@ -216,6 +216,20 @@ Returns the titlecase mapping of a string that is surrounded by a prefix
and a suffix.
@end deftypefun
+For example, to uppercase the UTF-8 substring between @code{s + start_index}
+and @code{s + end_index} of a string that extends from @code{s} to
+@code{s + u8_strlen (s)}, you can use the statements
+
+@smallexample
+size_t result_length;
+uint8_t result =
+ u8_ct_toupper (s + start_index, end_index - start_index,
+ u8_casing_prefix_context (s, start_index),
+ u8_casing_suffix_context (s + end_index,
+ u8_strlen (s) - end_index),
+ iso639_language, NULL, NULL, &result_length);
+@end smallexample
+
@node Case insensitive comparison
@section Case insensitive comparison