Class DtazvConvert
Collection of static character set and data type conversion utility method.
public static class DtazvConvert
- Inheritance
-
DtazvConvert
- Inherited Members
Methods
FromDta(byte)
Convert a byte from a DTAUS file to its corresponding character.
public static char FromDta(byte b)
Parameters
b
byteThe DTAUS byte to be converted.
Returns
- char
The Unicode character.
Remarks
Basically this method does nothing but convert the DTAUS0 or DTAUS1 encoded german umlaut characters to Unicode representations. All other bytes are returned as is.
FromDta(string)
Converts a given DTAUS encoded string into a Unicode string representation.
public static string FromDta(string s)
Parameters
s
stringString with characters in DTAUS0 or DTAUS1 encoding. If
null
, thennull
will be returned.
Returns
- string
Unicode string.
Remarks
Basically this method does nothing but convert the DTAUS0 or DTAUS1 encoded german umlaut characters to Unicode representations. All other characters are copied as is.
IsDta(char)
Tests whether the given character is an allowed DTAUS0 character.
public static bool IsDta(char ch)
Parameters
ch
char
Returns
IsDta(string)
Tests whether the given string contains only allowed DTAUS0 characters.
public static bool IsDta(string s)
Parameters
s
stringThe string to test. If this is
null
, thentrue
is returned.
Returns
ToDta(string, bool)
Converts a given unicode string into a DTAUS0 encoded string representation.
public static string ToDta(string s, bool fWithUmlaut)
Parameters
s
stringUnicode string to be converted to DTAUS0. If
null
, thennull
will be returned.fWithUmlaut
boolIf
true
, then the german Umlaut characters are converted just as described. Iffalse
, then the german Umlaut characters are converted as 'A', 'O', 'U', and 'S' respectively.
Returns
- string
DTAUS encoded string.
Remarks
The conversion will convert all lower case characters into upper case characters. All nonprinting character codes are converted to space characters. All foreign umlaut characters are converted into their non-umlaut base characters. The german umlaut characters 'AE', 'OE', 'UE', and 'sz' are converted to their DTAUS0 replacements '[', '', ']', and '~'. Any other symbol characters, or characters beyond '\xFF' are converted to single '.' characters.