Source/NFX/IOMiscUtils.cs
/// <summary>
/// Represents an ISO code as 4 byte integer filled with
/// up to 3 ASCII chars converted to upper case, the highest byte is free to be used by the application
/// </summary>
Represents an ISO code as 4 byte integer filled with
up to 3 ASCII chars converted to upper case, the highest byte is free to be used by the application
Represents an ISO code as 4 byte integer filled with up to 3 ASCII chars converted to upper case the highest byte is free to be used by the application
public static int PackISO3CodeToInt(string iso)
        {
          if (iso.IsNullOrWhiteSpace()) return 0;
          var l = iso.Length;
          if (l>3)
            throw new NFXException(StringConsts.ARGUMENT_ERROR+"PackISO3CodeToInt(iso>3)");
          var isoChar0 = (byte)iso[0];
          var isoChar1 = l>1 ? (byte)iso[1] : (byte)0x00;
          var isoChar2 = l>2 ? (byte)iso[2] : (byte)0x00;
          if (isoChar0>0x60) isoChar0 -= 0x20;
          if (isoChar1>0x60) isoChar1 -= 0x20;
          if (isoChar2>0x60) isoChar2 -= 0x20;
          var result = (isoChar2 << 16) + (isoChar1 << 8 ) + isoChar0;
          return result;
        }
public static int PackISO3CodeToInt ( string iso ) { if ( iso . IsNullOrWhiteSpace ( ) ) return 0 ; var l = iso . Length ; if ( l > 3 ) throw new NFXException ( StringConsts . ARGUMENT_ERROR + " " ) ; var isoChar0 = ( byte ) iso [ 0 ] ; var isoChar1 = l > 1 ? ( byte ) iso [ 1 ] : ( byte ) 0x00 ; var isoChar2 = l > 2 ? ( byte ) iso [ 2 ] : ( byte ) 0x00 ; if ( isoChar0 > 0x60 ) isoChar0 -= 0x20 ; if ( isoChar1 > 0x60 ) isoChar1 -= 0x20 ; if ( isoChar2 > 0x60 ) isoChar2 -= 0x20 ; var result = ( isoChar2 << 16 ) + ( isoChar1 << 8 ) + isoChar0 ; return result ; }
Represents an ISO code as 4 byte integer filled with
up to 3 ASCII chars converted to upper case, the highest byte is free to be used by the application
Represents an ISO code as 4 byte integer filled with up to 3 ASCII chars converted to upper case the highest byte is free to be used by the application
//note: ISO codes are in ASCII plane //convert to upper case //convert to upper case //convert to upper case
iso
string