1 | '\" |
---|
2 | '\" Copyright (c) 1997 by Sun Microsystems, Inc. |
---|
3 | '\" |
---|
4 | '\" See the file "license.terms" for information on usage and redistribution |
---|
5 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
6 | '\" |
---|
7 | '\" RCS: @(#) $Id: ToUpper.3,v 1.3 2004/09/06 09:44:57 dkf Exp $ |
---|
8 | '\" |
---|
9 | .so man.macros |
---|
10 | .TH Tcl_UtfToUpper 3 "8.1" Tcl "Tcl Library Procedures" |
---|
11 | .BS |
---|
12 | .SH NAME |
---|
13 | Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_UtfToLower, Tcl_UtfToTitle \- routines for manipulating the case of Unicode characters and UTF-8 strings |
---|
14 | .SH SYNOPSIS |
---|
15 | .nf |
---|
16 | \fB#include <tcl.h>\fR |
---|
17 | .sp |
---|
18 | Tcl_UniChar |
---|
19 | \fBTcl_UniCharToUpper\fR(\fIch\fR) |
---|
20 | .sp |
---|
21 | Tcl_UniChar |
---|
22 | \fBTcl_UniCharToLower\fR(\fIch\fR) |
---|
23 | .sp |
---|
24 | Tcl_UniChar |
---|
25 | \fBTcl_UniCharToTitle\fR(\fIch\fR) |
---|
26 | .sp |
---|
27 | int |
---|
28 | \fBTcl_UtfToUpper\fR(\fIstr\fR) |
---|
29 | .sp |
---|
30 | int |
---|
31 | \fBTcl_UtfToLower\fR(\fIstr\fR) |
---|
32 | .sp |
---|
33 | int |
---|
34 | \fBTcl_UtfToTitle\fR(\fIstr\fR) |
---|
35 | .SH ARGUMENTS |
---|
36 | .AS char *str in/out |
---|
37 | .AP int ch in |
---|
38 | The Tcl_UniChar to be converted. |
---|
39 | .AP char *str in/out |
---|
40 | Pointer to UTF-8 string to be converted in place. |
---|
41 | .BE |
---|
42 | |
---|
43 | .SH DESCRIPTION |
---|
44 | .PP |
---|
45 | The first three routines convert the case of individual Unicode characters: |
---|
46 | .PP |
---|
47 | If \fIch\fR represents a lower-case character, |
---|
48 | \fBTcl_UniCharToUpper\fR returns the corresponding upper-case |
---|
49 | character. If no upper-case character is defined, it returns the |
---|
50 | character unchanged. |
---|
51 | .PP |
---|
52 | If \fIch\fR represents an upper-case character, |
---|
53 | \fBTcl_UniCharToLower\fR returns the corresponding lower-case |
---|
54 | character. If no lower-case character is defined, it returns the |
---|
55 | character unchanged. |
---|
56 | .PP |
---|
57 | If \fIch\fR represents a lower-case character, |
---|
58 | \fBTcl_UniCharToTitle\fR returns the corresponding title-case |
---|
59 | character. If no title-case character is defined, it returns the |
---|
60 | corresponding upper-case character. If no upper-case character is |
---|
61 | defined, it returns the character unchanged. Title-case is defined |
---|
62 | for a small number of characters that have a different appearance when |
---|
63 | they are at the beginning of a capitalized word. |
---|
64 | .PP |
---|
65 | The next three routines convert the case of UTF-8 strings in place in |
---|
66 | memory: |
---|
67 | .PP |
---|
68 | \fBTcl_UtfToUpper\fR changes every UTF-8 character in \fIstr\fR to |
---|
69 | upper-case. Because changing the case of a character may change its |
---|
70 | size, the byte offset of each character in the resulting string may |
---|
71 | differ from its original location. \fBTcl_UtfToUpper\fR writes a null |
---|
72 | byte at the end of the converted string. \fBTcl_UtfToUpper\fR returns |
---|
73 | the new length of the string in bytes. This new length is guaranteed |
---|
74 | to be no longer than the original string length. |
---|
75 | .PP |
---|
76 | \fBTcl_UtfToLower\fR is the same as \fBTcl_UtfToUpper\fR except it |
---|
77 | turns each character in the string into its lower-case equivalent. |
---|
78 | .PP |
---|
79 | \fBTcl_UtfToTitle\fR is the same as \fBTcl_UtfToUpper\fR except it |
---|
80 | turns the first character in the string into its title-case equivalent |
---|
81 | and all following characters into their lower-case equivalents. |
---|
82 | |
---|
83 | .SH BUGS |
---|
84 | .PP |
---|
85 | At this time, the case conversions are only defined for the ISO8859-1 |
---|
86 | characters. Unicode characters above 0x00ff are not modified by these |
---|
87 | routines. |
---|
88 | |
---|
89 | .SH KEYWORDS |
---|
90 | utf, unicode, toupper, tolower, totitle, case |
---|