Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.47 -r1.48 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 4 Jun 2006 00:45:47 -0000 1.47 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 1 Nov 2006 19:18:07 -0000 1.48 @@ -19,6 +19,7 @@ -no_lines:boolean -no_quote:boolean -includes_html:boolean + -encode:boolean text } { Converts plaintext to html. Also translates any recognized @@ -29,6 +30,7 @@ semi-HTML input and preserve that formatting. This will also cause spaces/tabs to not be replaced with nbsp's, because this can too easily mess up HTML tags. @param includes_html Set this if the text parameter already contains some HTML which should be preserved. + @param encode This will encode international characters into it's html equivalent, like "�" into ü @author Branimir Dolicki (branimir@arsdigita.com) @author Lars Pind (lars@pinds.com) @@ -77,6 +79,32 @@ set text [ad_quotehtml $text] } + if { $encode_p} { + set myChars { + � � � � � � � � � � + � � � � � � � � � � + � � � � � � � � � � + � � � � � � � � � � + � � � � � � � � � � + � � � � � � � � � � + � � � � � + } + + set myHTML { + ª º À Á Â Ã Ä Å &Aelig; Ç + È É Ê Ë Ì Í Î Ï Ð Ñ + Ò Ó Ô Õ Ö Ø Ù Ú Û Ü + Ý Þ ß à á â ã ä å æ + ç è é ê ë ì í î ï ð + ñ ò ó ô õ ö ø ù ú û + ü ý þ ÿ ¿ + } + + for { set i 0 } { $i < [ llength $myChars ] } { incr i } { + set text [ string map "[ lindex $myChars $i ] [ lindex $myHTML $i ]" $text ] + } + } + # Convert line breaks if { !$no_lines_p } { set text [util_convert_line_breaks_to_html -includes_html=$includes_html_p -- $text]