summaryrefslogtreecommitdiffstats
path: root/library/icu.tcl
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2024-06-19 03:13:52 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2024-06-19 03:13:52 (GMT)
commit67c30ff0b5b8477c0f07a2d5b3ad36a881e16d74 (patch)
treef52dba75dc377f301c306db4f11a09225de43043 /library/icu.tcl
parent29d2d2d3750a61d70b87db010fac201568dc64ab (diff)
downloadtcl-67c30ff0b5b8477c0f07a2d5b3ad36a881e16d74.zip
tcl-67c30ff0b5b8477c0f07a2d5b3ad36a881e16d74.tar.gz
tcl-67c30ff0b5b8477c0f07a2d5b3ad36a881e16d74.tar.bz2
Handle ambiguous ICU encoding name aliases
Diffstat (limited to 'library/icu.tcl')
-rw-r--r--library/icu.tcl16
1 files changed, 13 insertions, 3 deletions
diff --git a/library/icu.tcl b/library/icu.tcl
index c256d00..827fd04 100644
--- a/library/icu.tcl
+++ b/library/icu.tcl
@@ -21,10 +21,13 @@ namespace eval ::tcl::unsupported::icu {
variable tclToIcu
variable icuToTcl
+ proc LogError {message} {
+ puts stderr $message
+ }
+
proc Init {} {
variable tclToIcu
variable icuToTcl
-
# There are some special cases where names do not line up
# at all. Map Tcl -> ICU
array set specialCases {
@@ -37,9 +40,14 @@ namespace eval ::tcl::unsupported::icu {
}
# Ignore all errors. Do not want to hold up Tcl
# if ICU not available
- catch {
+ if {[catch {
foreach tclName [encoding names] {
- set icuNames [aliases $tclName]
+ if {[catch {
+ set icuNames [aliases $tclName]
+ } erMsg]} {
+ LogError "Could not get aliases for $tclName: $erMsg"
+ continue
+ }
if {[llength $icuNames] == 0} {
# E.g. macGreek -> x-MacGreek
set icuNames [aliases x-$tclName]
@@ -62,6 +70,8 @@ namespace eval ::tcl::unsupported::icu {
lappend icuToTcl($icuName) $tclName
}
}
+ } errMsg]} {
+ LogError $errMsg
}
array default set tclToIcu ""
array default set icuToTcl ""