To illuminate simple encoding maybe this quick example will help.
This is a mild variation of one of the simplest and oldest encoding schemes, rot13.
Read more here:
https://en.wikipedia.org/wiki/ROT13(defun ROT45 ( text )
(vl-string-translate
"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~"
"PQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO"
text
)
)
Example:
(ROT45 "theswamp.org") >> "E96DH2>A[@C8"If you run ROT45 on text encoded by ROT45 it returns the original value:
(ROT45 "E96DH2>A[@C8") >> "theswamp.org"Or
(ROT45 (ROT45 "theswamp.org")) >> "theswamp.org"So let's say this is your naked dcl-def:
(setq temp
'(
"EdAtt : dialog {"
" label = \"Edit Attribute <TagString>\";"
" key = \"title\";"
" initial_focus = \"text\";"
" spacer;"
" : edit_box {"
" key = \"text\";"
" edit_width = 40;"
" edit_limit = 2048;"
" allow_accept = true;"
" }"
" spacer;"
" ok_cancel;"
" spacer;"
"}"
)
)
If we run ROT45 against it
(mapcar 'ROT45 temp) we get:
(
"t5pEE i 5:2=@8 L"
" =236= l \"t5:E pEEC:3FE6 k'28&EC:?8m\"j"
" <6J l \"E:E=6\"j"
" :?:E:2=17@4FD l \"E6IE\"j"
" DA246Cj"
" i 65:E13@I L"
" <6J l \"E6IE\"j"
" 65:E1H:5E9 l c^j"
" 65:E1=:>:E l a^cgj"
" 2==@H12446AE l ECF6j"
" N"
" DA246Cj"
" @<142?46=j"
" DA246Cj"
"N"
)This encoded string list is what you would place in your source file.
(setq dcl-def
'(
"t5pEE i 5:2=@8 L"
" =236= l \"t5:E pEEC:3FE6 k'28&EC:?8m\"j"
" <6J l \"E:E=6\"j"
" :?:E:2=17@4FD l \"E6IE\"j"
" DA246Cj"
" i 65:E13@I L"
" <6J l \"E6IE\"j"
" 65:E1H:5E9 l c^j"
" 65:E1=:>:E l a^cgj"
" 2==@H12446AE l ECF6j"
" N"
" DA246Cj"
" @<142?46=j"
" DA246Cj"
"N"
)
)
When you want to "unpack" it run ROT45 against it
(mapcar 'ROT45 dcl-def):
(
"EdAtt : dialog {"
" label = \"Edit Attribute <TagString>\";"
" key = \"title\";"
" initial_focus = \"text\";"
" spacer;"
" : edit_box {"
" key = \"text\";"
" edit_width = 40;"
" edit_limit = 2048;"
" allow_accept = true;"
" }"
" spacer;"
" ok_cancel;"
" spacer;"
"}"
)Notes: - While I penned this sample using ROT45 I would not use it in production code, too ez to recognize & break.
- AutoCAD does not need leading white space in dcl files, it's only there to make it ez for the reader to understand.
- Forgive any mistakes above, been a long day.
Hope this helps, cheers.