--- loncom/localize/lonlocal.pm 2003/09/28 03:02:36 1.15 +++ loncom/localize/lonlocal.pm 2003/10/02 17:35:57 1.17 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Localization routines # -# $Id: lonlocal.pm,v 1.15 2003/09/28 03:02:36 www Exp $ +# $Id: lonlocal.pm,v 1.17 2003/10/02 17:35:57 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -277,9 +277,21 @@ sub get_language_handle { if (&Apache::lonnet::mod_perl_version == 1) { $r->content_languages([¤t_language()]); } - setlocale(LC_ALL,¤t_locale); +### setlocale(LC_ALL,¤t_locale); } +# ==================== Normalize string (reduce fragility in the lexicon files) + +# This normalizes a string to reduce fragility in the lexicon files of +# huge messages (such as are used by the helper), and allow useful +# formatting: reduce all consecutive whitespace to a single space, +# and remove all HTML +sub normalize_string { + my $s = shift; + $s =~ s/\s+/ /g; + $s =~ s/<[^>]+>//g; + return $s; +} 1; __END__