Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9d945f4e72c16ae01b1dc9d2dc9d35223660ce41
Ticket: 1376892fffffffffffffffffffffffffffffffff
[:print:] wrong behaviour
User & Date: dkf on 2006-02-24 16:47:05
Changes

  1. icomment:
    Logged In: YES 
    user_id=79902
    
    The following C program indicates that there are large
    numbers of characters that satisfy isprint() but neither
    isalnum() nor ispunct()
    
    #include <ctype.h>
    #include <stdio.h>
    #include <locale.h>
    int main() {
       unsigned int i,j=1000000000;
       setlocale(LC_ALL, "en_GB.UTF-8");
       for (i=0 ; i<65536 ; i++) {
          if (isprint(i) && !isalnum(i) && !ispunct(i)) {
             if (i!=j+1) {
                printf("%04x-", i);
             }
             j = i;
          } else if (i == j+1) {
             printf("%04x\n", j);
          }
       }
       return 0;
    }
    
    Interestingly, there are also many characters that are
    isalnum||ispunct but not isprint. That seems very strange to
    me; perhaps we need to find a real spec and use that instead
    of guessing... :-)
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"