Documentation
Back to website >

ConvertAnsiToOem (Pascalscript)

Description

ConvertAnsiToOem converts the given string Ansi-String into an Oem-String.

Syntax

function ConvertAnsiToOem(const S: string): string;

Arguments

ConvertAnsiToOem converts the Ansi-String S into an Oem-String. OEM strings are the codepage 437 or 850 character set encoding used by DOS, the umlauts are converted as follows:

AnsiOEM ASCII
Ä142
ä132
Ö153
ö148
Ü154
ü129
ß225

The conversion from ANSI to OEM is useful if data for DOS applications is to be exported from the report generator.

Example

var
  S1: String;
  S2: String;
begin
  S1:='DOS-Ärger';
  S2:=ConvertAnsiToOem(S1);
  ShowMessage(S2);
end;

Rules to understand the script can be found here.

The text 'DOS-Ärger' is assigned to the string variable S1. The function ConvertAnsiToOem converts the text into OEM characters and assigns the result to the string variable S2. The OEM text cannot be displayed meaningfully on a Windows PC, but is only suitable for export purposes to DOS applications.

ShowMessage shows: DOS-Zrger