changeset 8:7ceb3b5aeaa4

Catch possible error exceptions in character set conversion.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 18 Aug 2011 12:46:12 +0300
parents 50b52294e93e
children 47c73165754b
files urllog.tcl
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/urllog.tcl	Wed Jun 22 19:58:14 2011 +0300
+++ b/urllog.tcl	Thu Aug 18 12:46:12 2011 +0300
@@ -460,7 +460,9 @@
 		if {[llength $umatches] > 0} {
 			set urlTitle [lindex $umatches 1]
 			if {$uconvert != 0} {
-				set urlTitle [encoding convertfrom $uencoding $urlTitle]
+				if {[catch {set urlTitle [encoding convertfrom $uencoding $urlTitle]} cerrmsg]} {
+					urllog_log "Error in charset conversion: $cerrmsg"
+				}
 			}
 			set urlTitle [urllog_convert_ent $urlTitle]
 			regsub -all "(^ *| *$)" $urlTitle "" urlTitle