--- jpeg-6b.orig/rdjpgcom.c 1997-10-12 02:41:04 +0400 +++ jpeg-6b/rdjpgcom.c 2004-10-11 20:31:38 +0400 @@ -15,6 +15,7 @@ #include "jinclude.h" /* get auto-config symbols, */ #include /* to declare isupper(), tolower() */ +#include /* for setlocale() */ #ifdef USE_SETMODE #include /* to declare setmode()'s parameter macros */ /* If you have setmode() but not , just delete this line: */ @@ -223,6 +224,7 @@ process_COM (void) unsigned int length; int ch; int lastch = 0; + const char *prev_locale; /* Get the marker parameter length count */ length = read_2_bytes(); @@ -231,6 +233,8 @@ process_COM (void) ERREXIT("Erroneous JPEG marker length"); length -= 2; + prev_locale = setlocale(LC_CTYPE, ""); + while (length > 0) { ch = read_1_byte(); /* Emit the character in a readable form. @@ -254,6 +258,9 @@ process_COM (void) length--; } printf("\n"); + + if (prev_locale) + setlocale(LC_CTYPE, "C"); }