cs_best_language strWhat it does:
Returns the best non-experimental language from an HTTP Accept-Language header string.Defined in: /web/philip/tcl/1-cs-defs.tcl
Source code:
set best_language "" set best_quality -1 foreach language [split $str ","] { set language [string trim $language] if { ![regexp {^([^;]+);q=([^;]+)$} $language "" language quality] } { set quality 1 } if { [regexp {^x-} $language] } { continue } if { $quality > $best_quality } { set best_language $language set best_quality $quality } } return $best_language