ToUpper.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1997 by Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: ToUpper.3,v 1.2 1999/04/16 00:46:33 stanton Exp $
- '"
- .so man.macros
- .TH Tcl_UtfToUpper 3 "8.1" Tcl "Tcl Library Procedures"
- .BS
- .SH NAME
- Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_UtfToLower, Tcl_UtfToTitle - routines for manipulating the case of Unicode characters and UTF-8 strings.
- .SH SYNOPSIS
- .nf
- fB#include <tcl.h>fR
- .sp
- Tcl_UniChar
- fBTcl_UniCharToUpperfR(fIchfR)
- .sp
- Tcl_UniChar
- fBTcl_UniCharToLowerfR(fIchfR)
- .sp
- Tcl_UniChar
- fBTcl_UniCharToTitlefR(fIchfR)
- .sp
- int
- fBTcl_UtfToUpperfR(fIstrfR)
- .sp
- int
- fBTcl_UtfToLowerfR(fIstrfR)
- .sp
- int
- fBTcl_UtfToTitlefR(fIstrfR)
- .SH ARGUMENTS
- .AS char *str in/out
- .AP int ch in
- The Tcl_UniChar to be converted.
- .AP char *str in/out
- Pointer to UTF-8 string to be converted in place.
- .BE
- .SH DESCRIPTION
- .PP
- The first three routines convert the case of individual Unicode characters:
- .PP
- If fIchfR represents a lower-case character,
- fBTcl_UniCharToUpperfR returns the corresponding upper-case
- character. If no upper-case character is defined, it returns the
- character unchanged.
- .PP
- If fIchfR represents an upper-case character,
- fBTcl_UniCharToLowerfR returns the corresponding lower-case
- character. If no lower-case character is defined, it returns the
- character unchanged.
- .PP
- If fIchfR represents a lower-case character,
- fBTcl_UniCharToTitlefR returns the corresponding title-case
- character. If no title-case character is defined, it returns the
- corresponding upper-case character. If no upper-case character is
- defined, it returns the character unchanged. Title-case is defined
- for a small number of characters that have a different appearance when
- they are at the beginning of a capitalized word.
- .PP
- The next three routines convert the case of UTF-8 strings in place in
- memory:
- .PP
- fBTcl_UtfToUpperfR changes every UTF-8 character in fIstrfR to
- upper-case. Because changing the case of a character may change its
- size, the byte offset of each character in the resulting string may
- differ from its original location. fBTcl_UtfToUpperfR writes a null
- byte at the end of the converted string. fBTcl_UtfToUpperfR returns
- the new length of the string in bytes. This new length is guaranteed
- to be no longer than the original string length.
- .PP
- fBTcl_UtfToLowerfR is the same as fBTcl_UtfToUpperfR except it
- turns each character in the string into its lower-case equivalent.
- .PP
- fBTcl_UtfToTitlefR is the same as fBTcl_UtfToUpperfR except it
- turns the first character in the string into its title-case equivalent
- and all following characters into their lower-case equivalents.
- .SH BUGS
- .PP
- At this time, the case conversions are only defined for the ISO8859-1
- characters. Unicode characters above 0x00ff are not modified by these
- routines.
- .SH KEYWORDS
- utf, unicode, toupper, tolower, totitle, case