values (Issue #5074)
- The scheduler now creates a PID file when not running on demand with a modern
service launcher (Issue #5080)
+- The web interface did not support newer language identifiers used by Microsoft
+ web browsers (Issue #5803)
- Updated the cups-files.conf and cupsd.conf file documentation for missing
directives (Issue #5084)
- Fixed an Avahi-related crash bug in the scheduler (Issue #5085, Issue #5086)
*ptr++ = (char)toupper(*language & 255);
*ptr = '\0';
+
+ /*
+ * Map Chinese region codes to legacy country codes.
+ */
+
+ if (!strcmp(country, "HANS"))
+ strlcpy(country, "CN", sizeof(country));
+ if (!strcmp(country, "HANT"))
+ strlcpy(country, "TW", sizeof(country));
}
if (*language == '.' && !charset[0])
else
auth_type[0] = '\0';
- if (con->request &&
- (attr = ippFindAttribute(con->request, "attributes-natural-language",
- IPP_TAG_LANGUAGE)) != NULL)
+ if (con->request && (attr = ippFindAttribute(con->request, "attributes-natural-language", IPP_TAG_LANGUAGE)) != NULL)
{
- switch (strlen(attr->values[0].string.text))
- {
- default :
- /*
- * This is an unknown or badly formatted language code; use
- * the POSIX locale...
- */
-
- strlcpy(lang, "LANG=C", sizeof(lang));
- break;
-
- case 2 :
- /*
- * Just the language code (ll)...
- */
+ cups_lang_t *language = cupsLangGet(ippGetString(attr, 0, NULL));
- snprintf(lang, sizeof(lang), "LANG=%s.UTF8",
- attr->values[0].string.text);
- break;
-
- case 5 :
- /*
- * Language and country code (ll-cc)...
- */
-
- snprintf(lang, sizeof(lang), "LANG=%c%c_%c%c.UTF8",
- attr->values[0].string.text[0],
- attr->values[0].string.text[1],
- toupper(attr->values[0].string.text[3] & 255),
- toupper(attr->values[0].string.text[4] & 255));
- break;
- }
+ snprintf(lang, sizeof(lang), "LANG=%s.UTF8", language->language);
+ cupsLangFree(language);
}
else if (con->language)
snprintf(lang, sizeof(lang), "LANG=%s.UTF8", con->language->language);