|Title:||Add C Locale-Exact CType Functions|
|Version:||$Revision: 1.4 $|
|Author:||Jeffrey Hobbs <jeff dot hobbs at acm dot org>|
|Created:||Monday, 08 January 2001|
This TIP adds functions to Tcl that are a subset of the standard ctype functions (isspace, isalpha, ...) that are ensured to operate only in the C locale (char < 0x80).
Tcl used to force the C locale everywhere in order to have parsing work as expected throughout Tcl, but that prevented certain i18n features from working correctly (like native character input). In enabling the i18n features, some bugs (like ) were exposed that required the C locale to be enabled to function properly. Since we don't want to force that requirement, creating ctype functions that work as if they were always in the C locale is the best solution.
Add a file generic/tclC.c (to parallel generic/tclUtf.c) that contains functions following the convention C_isspace, C_isalpha, ... These functions would use character or bit maps to ensure greatest speed and efficiency of the functions.
Not all use of the ctype functions need be replaced. Those that walk over a string, especially backwards, are the ones that need replacement.
This document is in the public domain.
[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]TIP AutoGenerator - written by Donal K. Fellows