Identify ASCII-Codes for UNICODE

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2009-04-28 in Download section
Identify ASCII-Codes for UNICODE
With this dataport you can easily identify which ASCII-characters correspond to UNICODE-signs.

This helps a lot when doing import/export of data, especially in countries such as Poland, Hungary, Czechia,...

Use this for a conversion such as:

Export Data conversion:
Function:
ConvChar_CZ_Exp(InputString_ : Text[1024]) : Text[1024]

WHILE i < STRLEN(InputString_)+1 DO BEGIN
i := i +1;
CASE InputString_ OF
'?':BEGIN
InputString_ := 239;
Char2 := 187;
Char3 := 191;
Char4 := 196;
Char5 := 155;
InputString_ := COPYSTR(InputString_,1,i) + FORMAT(Char) + FORMAT(Char2) + FORMAT(Char3) + FORMAT(Char4) + FORMAT(Char5) + COPYSTR(InputString_,i+1);
i := i + 1;
END;
'':BEGIN
InputString_ := 197;
Char := 161;
InputString_ := COPYSTR(InputString_,1,i) + FORMAT(Char) + COPYSTR(InputString_,i+1);
i := i + 1;
END;
'?':BEGIN
InputString_ := 196;
Char := 141;
InputString_ := COPYSTR(InputString_,1,i) + FORMAT(Char) + COPYSTR(InputString_,i+1);
i := i + 1;
END;
end;

EXIT(InputString_);


Import data conversion:

Function:
ConvertChar_CZ_Import(InputString_ : Text[1024]) : Text[1024]

FOR i := 1 TO STRLEN(InputString_) DO BEGIN
CASE InputString_ OF
197 :
BEGIN
CASE InputString_[i+1] OF
161: InputString_ := '';
153: InputString_ := '?';
190: InputString_ := '';
175: InputString_ := '?';
160: InputString_ := '';
152: InputString_ := '?';
189: InputString_ := '';
174: InputString_ := '?';
END;
InputString_ := COPYSTR(InputString_,1,i) + COPYSTR(InputString_,i+1);
END;
196 :
BEGIN
CASE InputString_[i+1] OF
141: InputString_ := '?';
154: InputString_ := '?';
140: InputString_ := '?';
END;
InputString_ := COPYSTR(InputString_,1,i) + COPYSTR(InputString_,i+1)
END;

EXIT(InputString_);

I encluded an example file which contains all special signs of the desired language. Import it with the dataport and you'll get a file which contains the ASCII-chars expressions.

If you need help for this please feel free to contact me.

http://www.mibuso.com/dlinfo.asp?FileID=941

Discuss this download here.

Comments

  • ajhvdbajhvdb Member Posts: 672
    :shock:

    Just noticed this.

    So if I have problems with some characters while importing, exporting I can use this to create 2 translation files...
    The first one I create in notepad with all my special characters. The second one, will be created by this code
    What to do next?
Sign In or Register to comment.