HOW is the Request.UserLanguages array sorted - by priority or alphabetically?
asp.net, http-headers, httprequest, internationalization, localization
Solution
The order the items appear (comma-separated) in the Accept-Language header is the order they'll appear in the UserLanguages property. The ";q=xx" portion isn't treated specially. You can test this by using a tool like Fiddler to submit arbitrary Accept-Language headers to the server and seeing the result of the UserLanguages property.
If you want to see the particular implementation of HttpRequest.UserLanguages, you can look at the related .NET Framework source code.
Problem
I know from the MS documentation that the `Request.UserLanguages` array is "sorted". What they don't say is whether the array is sorted by priority or alphabetically. For example, if my Accept-Languages header reads like this: ``` Accept-Language: gr, en-gb;q=0.8, en;q=0.7 ``` The priority sorting would be "gr", with a value of 1, followed by "en-gb" with a 0.8 value and then "en" with 0.7. The alphabetical sorting would be "en", "en-gb", "gr". I can't figure out how to test this. Any ideas?