Tcl_UtfToUpper(3)
π Tcl_UtfToUpper β bestie edition π
okay so this is the Tcl_UtfToUpper(3) page from the Tcl Library Procedures, and it's literally all about making letters go BIG, small, or that fancy in-between title-case situation. six routines, one vibe: case conversion for Unicode characters and UTF-8 strings. let's get into it π¦
β¨ 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 π
πΈ SYNOPSIS πΈ
#include <tcl.h>
int
Tcl_UniCharToUpper(ch)
int
Tcl_UniCharToLower(ch)
int
Tcl_UniCharToTitle(ch)
Tcl_Size
Tcl_UtfToUpper(str)
Tcl_Size
Tcl_UtfToLower(str)
Tcl_Size
Tcl_UtfToTitle(str)
π ARGUMENTS π
int ch(in) β the Unicode character you wanna convert. one single character, that's the whole job πchar *str(in/out) β pointer to a UTF-8 string that gets converted in place. yes bestie, in place, it edits the string right where it's sitting π
π DESCRIPTION π
so the first three routines are the single-character girlies. they each convert the case of one individual Unicode character:
- if
chis giving lower-case energy,Tcl_UniCharToLower... wait no,Tcl_UniCharToUpperreturns the matching upper-case character. and if there's no upper-case character defined for it? it just hands you back the character unchanged. no drama π - if
chis giving upper-case energy,Tcl_UniCharToLowerreturns the matching lower-case character. if no lower-case character is defined, again, character comes back unchanged, no cap β¨ - if
chis lower-case,Tcl_UniCharToTitlereturns the corresponding title-case character. if there's no title-case character defined, it returns the corresponding upper-case character instead. and if there's no upper-case character defined either? you guessed it β unchanged, character stays exactly as it was π«Ά- title-case is only defined for a small number of characters that look different when they're sitting at the beginning of a capitalized word. it's giving special-occasion formatting, not an everyday thing π
then the next three routines handle whole UTF-8 strings, converting them in place in memory:
Tcl_UtfToUpperchanges every UTF-8 character instrto upper-case. heads up though: because changing the case of a character can change its size, the byte offset of each character in the resulting string may not match where it was originally.Tcl_UtfToUpperwrites a null byte at the end of the converted string, and returns the new length of the string in bytes. that new length is guaranteed to be no longer than the original string length. iconic behavior fr fr π₯Tcl_UtfToLoweris the same asTcl_UtfToUpperexcept it turns each character in the string into its lower-case equivalent πTcl_UtfToTitleis the same asTcl_UtfToUpperexcept it turns the first character in the string into its title-case equivalent, and all the following characters into their lower-case equivalents. main character gets the crown, everyone else dresses down π
β KEYWORDS β
utf, unicode, toupper, tolower, totitle, case
not me writing an entire manpage and then having the audacity to sign off cutely, but here we are π
okay that's the whole page bestie, you're officially fluent in Unicode case manipulation π
β¨ this was Tcl 8.1, and yeah, Tcl_UtfToUpper(3) β that's the one, that's the page ππ¦πΈ
bye love u, go capitalize something π«Ά
π¦ where this page comes from
- alpine 3.23: tcl9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tcl9-doc 9.0.3-r2 Β· TCL
- fedora 43: tcl-doc 1:9.0.2-1.fc43 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- fedora 44: tcl-doc 1:9.0.2-1.fc44 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- nixos 26.05: tcl 9.0.3
- Copyright (c) 1997 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms