--- loncom/cgi/loncgi.pm 2011/10/21 20:00:30 1.12 +++ loncom/cgi/loncgi.pm 2014/10/14 19:54:00 1.14 @@ -1,7 +1,7 @@ # # LON-CAPA helpers for cgi-bin scripts # -# $Id: loncgi.pm,v 1.12 2011/10/21 20:00:30 raeburn Exp $ +# $Id: loncgi.pm,v 1.14 2014/10/14 19:54:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -154,7 +154,7 @@ Returns: undef ############################################# sub transfer_profile_to_env { my ($handle)=@_; - if (tie(my %disk_env,'GDBM_File',"$lonidsdir/$handle.id",&GDBM_READER(), + if (tie(my %disk_env,'GDBM_File',"$lonidsdir/$handle.id",&GDBM_READER(), 0640)) { %Apache::lonnet::env = %disk_env; untie(%disk_env); @@ -246,6 +246,9 @@ sub cgi_header { if ($contenttype ne '') { if ($mimetypes->type($contenttype) ne '') { $headers{'-type'} = $contenttype; + if ($contenttype =~ m{^text/}) { + $headers{'-charset'} = 'utf-8'; + } } } if ($nocache) {