Is it possible is asp to detect from the MobileCapabilities object if the device support arabic or not
+1
A:
You can use the Accept-Language header. It works for at least some phones. My Nokia bought from an Israli operator sends out:
Accept-Language: he-IL
You can access it from Request.Headers.
Hope this helps,
Asaf
Asaf R
2009-02-01 14:57:55
+1
A:
Yes, you can check the Accept-Language HTTP header for "ar" for arabic.
For example this real sample:
Accept-Language: en;q=1.0,fr;q=0.5,ar;q=0.5
Says, en (English) is accepted with a 100% quality, but you can give fr (French, France) too with a 50% quality (meaning, it's not my first choice, but I can live with it), and then ar (Arabic) is fine too.
Here are some sample Accept-Languages from mostly mobile devices: Ordered from least common to most common in this sample set:
Accept-Language: *
Accept-Language: English, Chinese
Accept-Language: en, en, fr-fr, pt-pt, en, sw-sw, zu-zu, yo-yo, af-af, ig-ig, st-st, ha-ha
Accept-Language: en-ZA, en;q=0.9
Accept-Language: en-au
Accept-Language: en-gb, en
Accept-Language: en-gb,en
Accept-Language: en-us, en;q=0.5
Accept-Language: en-za,en;q=0.7,af;q=0.3
Accept-Language: en; q=1.0, *; q=0.5
Accept-Language: en; q=1.0, en, *; q=0.5
Accept-Language: en;q=1.0, fr;q=0.5, de;q=0.5, tr;q=0.5, nl;q=0.5
Accept-Language: en;q=1.0, fr;q=0.5, pt;q=0.5
Accept-Language: en;q=1.0, nl;q=0.5, bg;q=0.5, ro;q=0.5
Accept-Language: en;q=1.0,en;q=0.5,vi;q=0.5
Accept-Language: en;q=1.0,fi;q=0.5,sv;q=0.5,no;q=0.5,is;q=0.5,da;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,de;q=0.5,it;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,de;q=0.5,it;q=0.5,es;q=0.5,pt;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,de;q=0.5,nl;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,de;q=0.5,pt;q=0.5,es;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,de;q=0.5,tr;q=0.5,nl;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,pt;q=0.5
Accept-Language: en;q=1.0,zh-cn, zh;q=0.5,en;q=0.5
Accept-Language: nb,en;q=0.9
Accept-Language: en-GB,en-US,en
Accept-Language: en-gb,en;q=0.5
Accept-Language: en-us, en
Accept-Language: en;q=1.0,fr;q=0.5,ar;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,nl;q=0.5,de;q=0.5,it;q=0.5
Accept-Language: en-GB,en;q=0.5
Accept-Language: en-US
Accept-Language: en;q=1.0, fr;q=0.5, de;q=0.5, es;q=0.5, it;q=0.5
Accept-Language: en;q=1.0,fr;q=0.5,de;q=0.5,es;q=0.5,it;q=0.5,pt;q=0.5
Accept-Language: en;q=1.0,nl;q=0.5
Accept-Language: id
Accept-Language: id,en;q=0.9
Accept-Language: en;q=1.0, fr;q=0.5, nl;q=0.5, de;q=0.5, it;q=0.5
Accept-Language: en;q=1.0, fr;q=0.5, pt;q=0.5, de;q=0.5
Accept-Language: en-gb, *; q=0.5
Accept-Language: en;q=1.0,de;q=0.5,it;q=0.5,fr;q=0.5
Accept-Language: zh-tw, zh-cn, en
Accept-Language: en-US,en
Accept-Language: en;q=1.0,de;q=0.5,it;q=0.5,fr;q=0.5,nl;q=0.5
Accept-Language: en-US,en;q=0.9
Accept-Language: en-ZA,en;q=0.9
Accept-Language: en-gb
Accept-Language: en-GB
Accept-Language: en-us
Accept-Language: en,en;q=0.9
Accept-Language: en-za
Accept-Language: en-us,en;q=0.5
Accept-Language: en
This also highlights the variations one gets in mobile device implementations.
DEF
2009-08-18 09:59:02