Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale::preferred may throw an exception but it's not caught in the framework default #386

Closed
greut opened this issue Mar 20, 2012 · 2 comments
Assignees

Comments

@greut
Copy link
Contributor

greut commented Mar 20, 2012

A very long title for someting quite simple actually.

The default way of setting the locale using Locale::preferred() may throw an exception in the header is strangely formatted in Locale::decompose(). But this exception is not caught by default (in the framework).

A list of headers we've got that are breaking stuff, if you also want to improve the tests (we are using 0.10 with a defined set of available languages (fr, de), that you know):

  • ru, uk;q=0.8, be;q=0.8, en;q=0.7, *;q=0.01 (Yandex)
  • en;q=0.9,*;q=0.8 (Exabot)
  • de-DE,de;q=0.7,chrome://global/locale/intl.properties;q=0.3 (WTF!! UA being Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0)
  • fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3,x-ns14sRVhG$uNxh,x-ns2H71M1Oj6$be WTF
  • empty string (Java/1.6.0_31)
  • es-419,es;q=0.8 (Chrome 17.x.x.x)
@greut
Copy link
Contributor Author

greut commented Mar 21, 2012

I wrote some tests on a branch: greut/lithium@UnionOfRAD:dev...386-locale-preferred Can someone take a look and give a feed about if they seem a correct behavior or not. Thanks!

greut added a commit to greut/lithium that referenced this issue Mar 24, 2012
* It makes the regex more strict regarding what can define a language (Issue UnionOfRAD#386)
greut added a commit to greut/lithium that referenced this issue Mar 27, 2012
@ghost ghost assigned mariuswilms Apr 19, 2012
@nateabele
Copy link
Member

The corresponding PR has been merged, so this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants