08-17-2013 02:35 AM
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.
08-17-2013 07:51 AM
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
08-17-2013 08:54 AM
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.
08-17-2013 09:00 AM
Works for me. Make sure you're saving in UTF-8 and not UTF-16.
08-17-2013 11:45 AM
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.
08-17-2013 12:00 PM
08-17-2013 12:23 PM
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
08-17-2013 12:34 PM
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.
08-18-2013 06:27 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide