From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: Possible bug Date: 24 Sep 2001 01:51:41 GMT Organization: Cornell University Lines: 88 Sender: asu1 AT cornell DOT invalid (on slip-32-102-40-118.ny.us.prserv.net) Message-ID: References: <004601c142e7$6f0a2920$323647a1 AT robert> <1pkoqt4ocnvr400nklea28vr51no8tkbsh AT 4ax DOT com> <9oi2nc$1jc$1 AT barcode DOT tesco DOT net> <1001244576 DOT 694282 AT queeg DOT ludd DOT luth DOT se> NNTP-Posting-Host: slip-32-102-40-118.ny.us.prserv.net X-Trace: news01.cit.cornell.edu 1001296301 17405 32.102.40.118 (24 Sep 2001 01:51:41 GMT) X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu NNTP-Posting-Date: 24 Sep 2001 01:51:41 GMT User-Agent: Xnews/4.06.22 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Radical NetSurfer wrote in news:jonsqtcta5q49o8eld6b6rbaithusd38k9 AT 4ax DOT com: > My only advice is use caution when using DJGPP and > checking for, and changing CASE of a string. Mostly because DJGPP only implements the C and POSIX locales as Eli pointed out some time ago. By the way, I have looked at the source code, and looked into how *nix systems as well as cygwin implements this, and it seems like more work than I can do at this time. > strupr/strlwr, toupper/tolower, > and especially, > isalpha, isupper/islower > should have always understood what an ALPHABETIC > character is, and what most certainly is NOT an alphabetic > character! sheesh! I don't understand this. The small program included below has no problem in this regard. Exactly what is the problem? >>: IT WAS A ROUTINE TO FILTER AND RENAME file names >>: from web-site (and usenet) downloads, that contained "freaky" foreign >>: and just dump-a** characters. i don't know what those characters are and i am curious to understand what specifically the problem is. can you post an example? sample program to test toupper and isalpha below: #include #include static const unsigned char* get_table(void) { static unsigned char table[256]; static int initialized; int i; if( initialized == 0 ) { for( i = 0; i < 256; ++i) table[i] = (unsigned char) i; initialized = 1; } return table; } static void dump_toupper(const unsigned char* table) { int i; for( i = 0; i < 256; ++i) printf("Code: %2.2X\tCharacter: %c\ttoupper: %c\n", table[i], table[i], toupper(table[i])); return; } static void dump_isalpha(const unsigned char* table) { int i; for( i = 0; i < 256; ++i) if( isalpha(table[i]) ) printf("Code: %2.2X\tAlphabetic Character: %c\n", table[i], table[i]); return; } int main(void) { printf("Convert to upper case: \n"); dump_toupper(get_table()); printf("Print alphabetic characters:\n"); dump_isalpha(get_table()); return 0; } -- -------------------------------- A. Sinan Unur http://www.unur.com/