TIP #20: ADD C LOCALE-EXACT CTYPE FUNCTIONS ============================================= Version: $Revision: 1.4 $ Author: Jeffrey Hobbs State: Deferred Type: Project Tcl-Version: 8.5 Vote: Pending Created: Monday, 08 January 2001 URL: https://tip.tcl-lang.org20.html Post-History: ------------------------------------------------------------------------- ABSTRACT ========== 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). RATIONALE =========== 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. REFERENCE IMPLEMENTATION ========================== 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. COPYRIGHT =========== This document is in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows