HOW is the array of Request.UserLanguages ​​arrays sorted - by priority or alphabetically?

I know from the MS documentation that the array is Request.UserLanguages"sorted". What they don't say is whether the array is sorted by priority or alphabetically.

For example, if the Accept-Languages ​​header reads as follows:

Accept-Language: gr, en-gb;q=0.8, en;q=0.7

The priority sorting will be “gr” with a value of 1, then “en-gb” with 0.8, and then “en” with 0.7.

Alphabetical sorting will be "en", "en-gb", "gr".

I can’t figure out how to check this. Any ideas?

+3
source share
1 answer

( ) Accept-Language - , UserLanguages. "; q = xx" . , Fiddler, Accept-Language UserLanguages.

HttpRequest.UserLanguages, .NET Framework http://referencesource.microsoft.com/netframework.aspx.

+3

All Articles