Skip to content
Tcl Source Code Artifact [a10ce5401a]
Login

Artifact [a10ce5401a]

Artifact a10ce5401a360dcb2448adf9b9220328f1b4d5aa:

Wiki page [UTF-8 String] by dgp on 2014-08-31 20:15:22.
D 2014-08-31T20:15:22.522
L UTF-8\sString
P e10c49e783b1a85f0ec93ad423c6ab885495299d
U dgp
W 2604
<h1>Source Files</h1>
  *  [/finfo?name=generic/tclUtf.c|tclUtf.c]
  *  [/finfo?name=win/tclWin32Dll.c|tclWin32Dll.c]

<h1>Public Interface</h1>
  *  Tcl_UniCharToUtf
  *  Tcl_UniCharToUtfDString
  *  Tcl_UtfToUniChar
  *  Tcl_UtfToUniCharDString
  *  Tcl_UtfCharComplete
  *  Tcl_NumUtfChars
  *  Tcl_UtfFindFirst
  *  Tcl_UtfFindLast
  *  Tcl_UtfNext
  *  Tcl_UtfPrev
  *  Tcl_UniCharAtIndex
  *  Tcl_UtfAtIndex
  *  Tcl_UtfBackslash
  *  Tcl_UtfToUpper
  *  Tcl_UtfToLower
  *  Tcl_UtfToTitle
  *  Tcl_UtfNcmp
  *  Tcl_UtfNcasecmp
  *  Tcl_UniCharToUpper
  *  Tcl_UniCharToLower
  *  Tcl_UniCharToTitle
  *  Tcl_UniCharLen
  *  Tcl_UniCharNcmp
  *  Tcl_UniCharNcasecmp
  *  Tcl_UniCharIsAlnum
  *  Tcl_UniCharIsAlpha
  *  Tcl_UniCharIsControl
  *  Tcl_UniCharIsDigit
  *  Tcl_UniCharIsGraph
  *  Tcl_UniCharIsLower
  *  Tcl_UniCharIsPrint
  *  Tcl_UniCharIsPunct
  *  Tcl_UniCharIsSpace
  *  Tcl_UniCharIsUpper
  *  Tcl_UniCharIsWordChar
  *  Tcl_UniCharCaseMatch
  *  Tcl_WinUtfToTChar
  *  Tcl_WinTCharToUtf

<h1>Private Interface</h1>
  *  TclUtfCasecmp
  *  TclUniCharMatch
  *  TclpUtfNcmp2

<h1>Directly Depends On Public Interface</h1>
  *  [Object System and Fundamental Object Types]

<h1>Directly Depends On Private Interface of</h1>
  *  [Parsing and Evaluation]
 
<h1>Discussion</h1>

This module provides a set of utility functions to operate on Tcl_UniChar arrays
and char arrays with content in the internal encoding of Tcl 8.  This encoding is
misleadingly referred to as "Utf".  Many of the functions expose the categorizations
of <i>case</i> and character classes defined by Unicode.

The <i>tclWin32Dll.c</i> file contains other routines not mentioned here, but
they do not appear to belong in this function area.  The routines <b>Tcl_Win*To*</b>
that are mentioned here appear to be legacy routines only for Windows
platforms we no longer support.  They are nothing more than typecasts applied to
other public routines.

The dependence on [Parsing and Evaluation] internals is only in <b>Tcl_UtfBackslash</b>
which arguably belongs in parsing instead, and the use of <b>TclIsSpaceProc</b> which
could easily be avoided.  The dependence on [Object System and Fundamental Object Types]
is only in the exporting interfaces to <b>Tcl_DString</b>, also easily remedied.  This
module is well within reach of being entirely self contained.

The three private routines are likely good candidates for exporting.  They have callers.
In some cases perhaps they are preferred replacements for something already public.
Z 67e3180b613d467668574fcaf22c31eb