unicode(3tcl)
π unicode β the normalization glow-up π
okay bestie, so this is unicode(3tcl) β the Tcl manual page all about Unicode normalization β¨ and ngl it's lowkey iconic. it lives in tcllib and it's here to make your strings behave. let's get into it π«Ά
β¨ NAME β¨
unicode β implementation of Unicode normalization π
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require unicode 1.1.1
::unicode::fromstring string
::unicode::tostring uclist
::unicode::normalize form uclist
::unicode::normalizeS form string
like, that's the whole vibe right there π
π¦ DESCRIPTION π¦
this is an implementation in Tcl of the Unicode normalization forms. that's it, that's the whole thing. no cap π
π COMMANDS π
the main character energy lives here fr fr:
::unicode::fromstring stringβ takes string and converts it into a list of integer Unicode character codes, which is whatunicodeuses for its internal string representation. so like, the β¨realβ¨ form of your string.::unicode::tostring uclistβ the glow-down (but in a good way): converts that list of integers uclist back into a Tcl string. reverse uno card π::unicode::normalize form uclistβ normalizes the Unicode characters listulistaccording to form, and hands you back the normalized list. and form can be one of these four:Dβ canonical decompositionCβ canonical decomposition, followed by canonical compositionKDβ compatibility decompositionKCβ compatibility decomposition, followed by canonical composition
::unicode::normalizeS form stringβ the shortcut bestie!! it's literally just::unicode::tostring [unicode::normalize $form [::unicode::fromstring $string]]. normalizes a Tcl string and returns the normalized string. normalize + string = normalizeS, iykyk π
π₯ EXAMPLES π₯
watch and learn, this is the tutorial arc:
% ::unicode::fromstring "\u0410\u0411\u0412\u0413"
1040 1041 1042 1043
% ::unicode::tostring {49 50 51 52 53}
12345
%
% ::unicode::normalize D {7692 775}
68 803 775
% ::unicode::normalizeS KD "\u1d2c"
A
%
see?? it just works. slay π
β REFERENCES β
- "Unicode Standard Annex #15: Unicode Normalization Forms", (
http://unicode.org/reports/tr15/)
π AUTHORS π
Sergei Golovan
π BUGS, IDEAS, FEEDBACK π
okay so real talk β this document, and the package it describes, will undoubtedly contain bugs and other problems. like, guaranteed. so please report them in the category stringprep of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. and if you've got ideas for enhancements for either the package and/or the documentation, pls also drop those π
when proposing code changes, please provide unified diffs, i.e the output of diff -u.
also note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. that's the move π
π§ SEE ALSO π§
π KEYWORDS π
normalization, unicode
π COPYRIGHT π
Copyright (c) 2007, Sergei Golovan <sgolovan@nes.ru>
and that's a wrap bestie!! this page came to you from tcllib, version 1.1.1, and the manual page is dated unicode(3tcl) β¨ mwah, go normalize something, you got this ππ
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2007, Sergei Golovan <sgolovan@nes\&.ru>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms