unicode(n)
π unicode(n) β Unicode normalization, but make it iconic π
okay bestie, sit down, we're doing Unicode normalization today and honestly? it's giving main character energy. this is the unicode manual page from tcllib, section n, and it is literally the implementation of Unicode normalization forms in Tcl. no cap.
β¨ 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
so first you gotta package require Tcl 8.5 9, then package require unicode 1.1.1, and then you have four little besties to play with π«Ά
πΈ DESCRIPTION πΈ
this is an implementation in Tcl of the Unicode normalization forms. that's it, that's the vibe. it normalizes. it's Unicode. it slays. π
π COMMANDS π
π¦ ::unicode::fromstring string
converts string to a list of integer Unicode character codes β which is the format unicode uses for its internal string representation. so like, you hand it a cute little string, it hands you back the numbers. glow up moment β¨
π¦ ::unicode::tostring uclist
converts a list of integers uclist back to a Tcl string. it's the reverse glow-down. the numbers become words again. iconic.
π¦ ::unicode::normalize form uclist
normalizes the Unicode characters list ulist according to form, and returns the normalized list. so what can form be, you ask? bestie, exactly four things:
Dβ canonical decompositionCβ canonical decomposition, followed by canonical compositionKDβ compatibility decompositionKCβ compatibility decomposition, followed by canonical composition
periodt. those are the only four. don't try to be creative. π
π¦ ::unicode::normalizeS form string
this one is a shortcut, and honestly it's the lazy-girl boss move. it's literally:
::unicode::tostring [unicode::normalize $form [::unicode::fromstring $string]]
it normalizes a Tcl string and returns a normalized string. no list of integers in between, no extra steps, just vibes and results. π₯
π EXAMPLES π
watch and learn, bestie:
% ::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 how \u1d2c just became a whole entire A? that's the compatibility decomposition doing its thing. ate. π
π REFERENCES π
- "Unicode Standard Annex #15: Unicode Normalization Forms", (http://unicode.org/reports/tr15/)
go read it, it's the source material, the lore, the origin story. π§
β AUTHORS β
Sergei Golovan. thank you king, we appreciate you. π
π BUGS, IDEAS, FEEDBACK π
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. that's just how software is, bestie. no shame.
- please report such in the category
stringprepof the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist] - please also report any ideas for enhancements you may have for either package and/or documentation
when proposing code changes, please provide unified diffs, i.e the output of diff -u.
also, heads up: 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. yes, that's a lot of steps, but it's the way. π
π SEE ALSO π
π KEYWORDS π
- normalization
- unicode
π COPYRIGHT π
Copyright (c) 2007, Sergei Golovan <sgolovan@nes.ru>
and that's the whole page, bestie!! this one came from tcllib, version 1.1.1 β the unicode(n) page, written up all cute just for you. now go normalize something and be free π¦β¨π
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- 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