--- loncom/interface/loncommon.pm 2003/09/17 18:15:54 1.120 +++ loncom/interface/loncommon.pm 2003/09/21 20:06:36 1.123 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.120 2003/09/17 18:15:54 www Exp $ +# $Id: loncommon.pm,v 1.123 2003/09/21 20:06:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1661,14 +1661,9 @@ sub preferred_languages { push (@genlanguages,(split(/(\-|\_)/,$_))[0]); } } - &Apache::lonnet::logthis('Lang: '.join(',',@genlanguages)); return @genlanguages; } -sub current_language { - return (&preferred_languages)[0]; -} - ############################################################### ## Student Answer Attempts ## ############################################################### @@ -2326,6 +2321,14 @@ sub no_cache { #$r->header_out("Expires" => $date); } +sub content_type { + my ($r,$type,$charset) = @_; + unless ($charset) { + $charset=&Apache::lonlocal::current_encoding; + } + $r->content_type($type.($charset?'; charset='.$charset:'')); +} + =pod =item * add_to_env($name,$value)