resource_info,&windows->context);
(void) CloneString(&class_hints->res_name,resource_info->client_name);
(void) CloneString(&class_hints->res_class,resource_info->client_name);
- class_hints->res_class[0]=(char) toupper((int) class_hints->res_class[0]);
+ class_hints->res_class[0]=(char) LocaleUppercase((int)
+ class_hints->res_class[0]);
manager_hints->flags=InputHint | StateHint;
manager_hints->input=MagickFalse;
manager_hints->initial_state=WithdrawnState;
resource_info,&windows->context);
(void) CloneString(&class_hints->res_name,resource_info->client_name);
(void) CloneString(&class_hints->res_class,resource_info->client_name);
- class_hints->res_class[0]=(char) toupper((int) class_hints->res_class[0]);
+ class_hints->res_class[0]=(char) LocaleUppercase((int)
+ class_hints->res_class[0]);
manager_hints->flags=InputHint | StateHint;
manager_hints->input=MagickFalse;
manager_hints->initial_state=WithdrawnState;
assert(string != (char *) NULL);
for (q=string; *q != '\0'; q++)
- *q=(char) tolower((int) *q);
+ *q=(char) LocaleLowercase((int) *q);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+% L o c a l e L o w e r c a s e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% LocaleLowercase() convert to uppercase.
+%
+% The format of the LocaleLowercase method is:
+%
+% void LocaleLowercase(const int c)
+%
+% A description of each parameter follows:
+%
+% o If c is a uppercase letter, return its lowercase equivalent.
+%
+*/
+MagickExport int LocaleLowercase(const int c)
+{
+ locale_t
+ locale;
+
+ locale=AcquireCLocale();
+ if (locale == (locale_t) NULL)
+ return(tolower(c));
+ return(tolower_l(c,locale));
}
\f
/*
assert(string != (char *) NULL);
for (q=string; *q != '\0'; q++)
- *q=(char) toupper((int) *q);
+ *q=(char) LocaleUppercase((int) *q);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+% L o c a l e U p p e r c a s e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% LocaleUppercase() convert to uppercase.
+%
+% The format of the LocaleUppercase method is:
+%
+% void LocaleUppercase(const int c)
+%
+% A description of each parameter follows:
+%
+% o If c is a lowercase letter, return its uppercase equivalent.
+%
+*/
+MagickExport int LocaleUppercase(const int c)
+{
+ locale_t
+ locale;
+
+ locale=AcquireCLocale();
+ if (locale == (locale_t) NULL)
+ return(toupper(c));
+ return(toupper_l(c,locale));
}
\f
/*
extern MagickExport int
LocaleCompare(const char *,const char *) magick_attribute((__pure__)),
+ LocaleLowercase(const int),
LocaleNCompare(const char *,const char *,const size_t)
- magick_attribute((__pure__));
+ magick_attribute((__pure__)),
+ LocaleUppercase(const int);
extern MagickExport LinkedListInfo
*DestroyLocaleOptions(LinkedListInfo *),
assert(magick != (char *) NULL);
if (strlen(magick) > 1)
return(MagickFalse);
- status=(GetLogicalDrives() & (1 << ((toupper((int) (*magick)))-'A'))) != 0 ?
- MagickTrue : MagickFalse;
+ status=(GetLogicalDrives() & (1 << ((LocaleUppercase((int)
+ (*magick)))-'A'))) != 0 ? MagickTrue : MagickFalse;
return(status);
}
\f
{
if (case_insensitive != MagickFalse)
{
- if (tolower((int) GetUTFCode(expression)) !=
- tolower((int) GetUTFCode(pattern)))
+ if (LocaleLowercase((int) GetUTFCode(expression)) != LocaleLowercase((int) GetUTFCode(pattern)))
{
done=MagickTrue;
break;
{
case 1:
{
- string[i]=(char) toupper(c);
+ string[i]=(char) LocaleUppercase(c);
break;
}
case 2:
{
- string[i]=(char) tolower(c);
+ string[i]=(char) LocaleLowercase(c);
break;
}
default:
buffer[sizeof(buffer)-1]='\0';
for (p=buffer; *p; p++)
if (isupper((int) ((unsigned char) *p)))
- *p=tolower(*p);
+ *p=LocaleLowercase(*p);
/*
Skip any directory component and just copy the name.
*/
{
if (isspace((int) ((unsigned char) keyword[i])) != 0)
break;
- keyword[i]=tolower((int) ((unsigned char) keyword[i]));
+ keyword[i]=LocaleLowercase((int) ((unsigned char) keyword[i]));
}
keyword[i]='\0';
count=ReadBlob(image,72,(unsigned char *) value);
break;
i=(*p);
if (islower(i))
- i=toupper(i);
+ i=LocaleUppercase(i);
j=(*q);
if (islower(j))
- j=toupper(j);
+ j=LocaleUppercase(j);
if (i != j)
break;
n--;
p++;
q++;
}
- return(toupper((int) *p)-toupper((int) *q));
+ return(LocaleUppercase((int) *p)-LocaleUppercase((int) *q));
}
static size_t convertHTMLcodes(char *s)