cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2827
Views
0
Helpful
8
Replies

TCl proc string map

peraocompany
Level 1
Level 1

                   Hello I use custom translation code for TCL, and need help.

Code is:

proc translit { str } {

set str [string map -nocase {А A Б B В V Г G Д D Е E Ё E Ж J З Z И I Й I К K Л L М M Н N О O П P Р R С S Т T У U Ф F Х H Ц C Ч Ch Ш Sh Щ Sch Ь ' Ы Y Ъ ' Э E Ю Yu Я Ya а a б b в v г g д d е e ё e ж j з z и i й i к k л l м m н n о o п p р r с s т t у u ф f х h ц c ч ch ш sh щ sch ь ' ы y ъ ' э e ю yu я ya} $str]

return $str

}

puts stdout [translit "АБВГДЕЁЖЗИК"]

cisco gets line %HA_EM-6-LOG: script.tcl: ABVGdе╗JZхй

Why some symbol change correct, like AБВГ and some not correct?

Thank you.

8 Replies 8

Joe Clarke
Cisco Employee
Cisco Employee

This is likely the way you've saved the file.  I saved it as a UTF-8 text file, and IOS produces what I imagine are correct results:

ABVGDEEJZIK

Thank you Joseph. I save file in UTF-8, and try registration script in EEM, ios get error:

EEM Register event failed: Error empty reg spec, policy does not start with EEM                                               registration commands.

EEM configuration: failed to retrieve intermediate registration result for policy script.tcl

If i use unicode ios not get error, but i have problem with string map.

Works for me.  Make sure you're saving in UTF-8 and not UTF-16.

It is very intrasting.

I try use netepad and notepad++ for save file.

for UTF-8 ios can not registrate script.

for UTF-8 (no BOM) script registrated but get not corect symbol

%HA_EM-6-LOG: script.tcl: п⌠п╣пҐп╣rп╟tп╬r

for ANSI script registred but get not correct symbol:

%HA_EM-6-LOG: script.tcl: ABVGdе╗JZхй

May be you attache file for test on my device. Thank you.

This is the script I used.

Thank you Joseph.

I load this file with out any changing.

and my IOS cli get not correct symbol.

%HA_EM-6-LOG: translit.tcl: п░п▒п▓п⌠п■п•eп√п≈п≤п

I use SW  IOS  15.0(2)SE4

Embedded Event Manager Version 3.20

Component Versions:

eem: (320_rel3)1.0.0

eem-gold: (v320_rel1)1.0.0

eem-call-home: (v320_rel1)1.0.2

On my Cisco router IOS get correct symbol.

23:22:00: %HA_EM-6-LOG: translit.tcl: ABVGDEEJZIK

Version 15.1(4)M5

It does look like an issue on the switches as I see it, too on a 3560.  I don't see a workaround, though.  If you want to further track this down, I recommend you open a TAC service request.

Thank you Joseph, my sw is WS-C3560-8PC-S 3560 series too.

Now i downgrade to 12.2(55)SE8 and this problem resloved. I have correct translit script workon.

Thank you.

Review Cisco Networking for a $25 gift card