PHP код:
Win2DOS(TextValue : Text[1024]) : Text[1024]
FOR i := 1 TO STRLEN(TextValue) DO BEGIN
ByteValue := TextValue[i];
IF ByteValue = 185 THEN
ByteValue := 252;
IF ByteValue IN [192..239] THEN
ByteValue -= 64;
IF ByteValue IN [240..255] THEN
ByteValue -= 16;
TextValue[i] := ByteValue;
END;
EXIT(TextValue);