SIMCONNECT_DATA_FACILITY_AIRPORT does not contain region

Hi, a couple of months later :hourglass: :smiley:… In the thread WASM Facility Subscription Does Not Return Region, below answer is given but it seems impossible to extract the region using C#:

Hi Can you check in the Icao field, both information should be in there. This
is a char[9] field where:

  • Ident is located from 0 to 5
  • Region is located from 6 to 9

Best Regards Maxile / Asobo

In C#, the SIMCONNECT_DATA_FACILITY_AIRPORT class is defined as below. It is not possible to extract the region from the field, maybe because Icao is null terminated and therefor hiding the region from the marshalling logic? How can I retrieve the region from the Icao field using C#?

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class SIMCONNECT_DATA_FACILITY_AIRPORT
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)]
    public string Icao;

    public double Latitude;

    public double Longitude;

    public double Altitude;
}