You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/08/13 16:45:23 UTC

[Bug 56848] New: Tomcat accept-language parsing doesn't properly handle IETF BCP47 language tags

https://issues.apache.org/bugzilla/show_bug.cgi?id=56848

            Bug ID: 56848
           Summary: Tomcat accept-language parsing doesn't properly handle
                    IETF BCP47 language tags
           Product: Tomcat 7
           Version: 7.0.55
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: dopey@moonteeth.com

Microsoft started using IETF BCP 47 language tags in Windows 8, so for
languages such as Chinese Traditional (formerly zh-CN) and Chinese Simplified
(formerly zh-TW) the default language tags are now zh-hant-CN and zh-hans-TW
respectively.

The tomcat accept-language parsing method Request.parseLocalHeaders doesn't
handle these tags properly.

Here's the bcp 47 spec:
http://tools.ietf.org/html/bcp47

And here's a description of some of the changes in Java 7 for this:
http://docs.oracle.com/javase/tutorial/i18n/locale/create.html

Where Java 7 is involved, the Locale.forLanguageTag method
http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#forLanguageTag(java.lang.String)

works well assuming a fully compliant language tag.  Perhaps Tomcat should try
to make use of this via reflection instead of parsing the entry?  The grammar
for bcp47 tags doesn't make for easy parsing as various subsections of the tag
are only valid if they match to particular ISO codes.
see:
http://tools.ietf.org/html/bcp47#section-2.1

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56848] Tomcat accept-language parsing doesn't properly handle IETF BCP47 language tags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56848

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
This has been fixed in 8.0.x for 8.0.11 onwards.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56848] Tomcat accept-language parsing doesn't properly handle IETF BCP47 language tags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56848

--- Comment #4 from Andy Wang <do...@moonteeth.com> ---
Would it make sense to try to use reflection and only support BCP47 if Java 7+
is used?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56848] Tomcat accept-language parsing doesn't properly handle IETF BCP47 language tags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56848

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
This has also been fixed in 7.0.x for 7.0.56 onwards.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56848] Tomcat accept-language parsing doesn't properly handle IETF BCP47 language tags

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56848

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
The fix is Java 7 specific. Tomcat 7 has to run on Java 6 and there simply
isn't the support for BCP47 in the Java 7 API.

I'm leaning towards resolving this as WONTFIX.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org