User convertors

What are they?

Convertor is used to automate char or string bidirectional conversion.


Location of Convertor Files

In subdirectory .\Convert. Convertor definition files are simple text files with INI files structure. In this dir you find the file Template.IN_ - a convertor base template. Convertors can be called from menu Tools / User Convertors...


Convertor syntax

;semicolon is comment - optional, is ignored
;section names are bold - mandatory
;red color - mandatory text. Must be set.
[Description]
;convertor description - will be displayed in menu
ForwardName=UNICODE chars to HTML entity (WML)
BackwardName=HTML entity (WML) to UNICODE chars
;set of char case ignore. 1 = yes, 0 = no
ForwardIgnoreCase=0
BackWardIgnoreCase=0
;sets whether conversion will be processed with char table or replacing string by string
CharTable=0
;section for replacing string by string. Strings are delimited by | char (pipe or bar)
[Conversion]
Š|Š
Œ|Ś
|Ť
;list of char, which will be removed during conversion
[Remove chars]
10
12
;char conversion table. Numbers are char ASCII values. Write only chars you want to convert.
[Table]
134=64
135=12

Conversion char table or string replace?

It depends of convertor meaning. If you want do code page conversion or replace tabs with spaces, use char table. It will be more precise and faster. Otherwise, use string replace.


How conversion char table works

Convertor works with selected block of text or whole document. This text (selected or whole doc) is processed char by char and chars are replaced by corresponding char from conversion table.


How string replace works

Convertor works with selected block of text or whole document. All strings defined in [Conversion] section are applied to the text. It's like a Search/Replace function. For long text, this can take some time.


String conversion possible problems

Circlur definition:

[Conversion]
B|A
A|B

In this case, first all "B" chars replaced with "A" and in next all "A" are replaced with "B" - The result is nothing changes.

[Conversion]
hallo|hi
halloween|party

First, all occurrences of hallo are replaced with hi. After first replace, the word halloween will be word hiween and second step replaces nothing. There are no more halloween words left.

All you need to correct it is to change the position in conversion definition to:

[Conversion]
halloween|party
hallo|hi