<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://www.tcl.tk/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Wed Jun 19 01:53:42 GMT 2013 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='20'>
<header><title>Add C Locale-Exact CType Functions</title><author address="mailto:jeff.hobbs@acm.org">Jeffrey Hobbs</author><status type='project' state='deferred' tclversion="8.5" vote='prior'>$Revision: 1.4 $</status><history></history><created day='8' month='jan' year='2001' /></header>
<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 &lt; 0x80).</abstract>
<body><section title="Rationale">
<para>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 [<url ref="http://sf.net/bugs/?func=detailbug&amp;bug_id=127512&amp;group_id=10894"/>]) were exposed that required the C locale to be enabled to function properly. Since we don&apos;t want to force that requirement, creating ctype functions that work as if they were always in the C locale is the best solution.</para>
</section>
<section title="Reference Implementation">
<para>Add a file <emph style="italic">generic/tclC.c</emph> (to parallel <emph style="italic">generic/tclUtf.c</emph>) 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.</para>
<para>Not all use of the ctype functions need be replaced. Those that walk over a string, especially backwards, are the ones that need replacement.</para>
</section>
<section title="Copyright">
<para>This document is in the public domain. </para>
</section>
</body></TIP>
