- for {set i 0} {$i < [string length $marc]} {incr i 2} {
- lappend hex [string range $marc $i [expr $i+1]]
+ if {$reverse} {
+ for {set i 0} {$i < [string length $utf]} {incr i 2} {
+ lappend hex [string range $utf $i [expr $i+1]]
+ }
+ # puts "ins_trie $hex $marc
+ ins_trie $hex $marc $combining $codename
+ unset hex
+
+ } else {
+ for {set i 0} {$i < [string length $marc]} {incr i 2} {
+ lappend hex [string range $marc $i [expr $i+1]]
+ }
+ # puts "ins_trie $hex $ucs"
+ ins_trie $hex $ucs $combining $codename
+ unset hex
+ }
+ }
+ if {$reverse && [string length $marc]} {
+ for {set i 0} {$i < [string length $altutf]} {incr i 2} {
+ lappend hex [string range $altutf $i [expr $i+1]]
+ }
+ if {[info exists hex]} {
+ ins_trie $hex $marc $combining $codename
+ unset hex