https://bz.apache.org/bugzilla/show_bug.cgi?id=59295

            Bug ID: 59295
           Summary: Content-Language headers created by Response.setLocale
                    do not fully represent the locale
           Product: Tomcat 8
           Version: 8.0.28
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 33743
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33743&action=edit
Patch file with a fix. Based off of the trunk of the Tomcat 8.0 branch.

The org.apache.coyote.Response class's setLocale method sets the
Content-Language header based on the Java Locale object passed in, but the
language tag it produces is only based on the Locale's language and region. It
should allow the full variety of language tags described in RFC 5646.

For example, this code sets a Locale object on a response for the Chinese
language, in China, with the traditional chinese script variant:

Locale locale = Locale.forLanguageTag("zh-hant-CN");
response.setLocale(locale);

But the Content-Language header produced in the response will look like this,
with the script variant being lost:

Content-Language:zh-CN

I believe the solution is simply to set the Content-Language header by using
the Locale's toLanguageTag method instead of manually creating the language tag
strings as the setLocale method currently does.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to