Tcl Library Source Code

unicode - Unicode normalization
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to
or submit via the online form by Aug 20.

[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

unicode(n) 1.0.0 tcllib "Unicode normalization"


unicode - Implementation of Unicode normalization


This is an implementation in Tcl of the Unicode normalization forms.


::unicode::fromstring string

Converts string to list of integer Unicode character codes which is used in unicode for internal string representation.

::unicode::tostring uclist

Converts list of integers uclist back to Tcl string.

::unicode::normalize form uclist

Normalizes Unicode characters list ulist according to form and returns the normalized list. Form form takes one of the following values: D (canonical decomposition), C (canonical decomposition, followed by canonical composition), KD (compatibility decomposition), or KC (compatibility decomposition, followed by canonical composition).

::unicode::normalizeS form string

A shortcut to ::unicode::tostring [unicode::normalize \$form [::unicode::fromstring \$string]]. Normalizes Tcl string and returns normalized string.


% ::unicode::fromstring "\u0410\u0411\u0412\u0413"
1040 1041 1042 1043
% ::unicode::tostring {49 50 51 52 53}
% ::unicode::normalize D {7692 775}
68 803 775
% ::unicode::normalizeS KD "\u1d2c"


  1. "Unicode Standard Annex #15: Unicode Normalization Forms", (


Sergei Golovan

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category stringprep of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.