Inspired by Stefan Glienke’s post about the new intrinsic type related functions in XE7, I went spelunking in the VCL and RTL differences between XE6 and XE7. More differences than I expected.
Some of them stand out.
TStream got a big overhaul. I wonder if it did anything to it’s performance, or if it was mostly about doing away with a lot of potentially troublesome endian related shl/shr operations? Atleast the code looks a lot cleaner now.
DesignIntf has a new method
function CreateChild(ComponentClass: TComponentClass; Parent: TComponent): TComponent;
Windows.WinApi adds a number of Windows API functions related to locale, time, date and languages, as well as SID to String and String to SID, and what appears to be a relatively complete list of country codes CTRY_xxxx (Norway = 47, Germany=49, France=33, UK=44, US=1). Interestingly, these are not unique numbers. Go figure.
Those country codes look like the international telephone prefixes. Several countries share those codes (IIRC, the US and Canada both have 1), so that would fit.
Martijn Coppoolse – You are right. Apart from alphabetic codes, is there any other standard enumeration for countries, preferably numeric?
Lars Fosdal http://en.wikipedia.org/wiki/ISO_3166-1
Lars Fosdal How about ISO 3166-1 numeric?
http://en.wikipedia.org/wiki/ISO_3166-1_numeric
Or by combining the ASCII codes of the alphabetic codes (ISO 3166-1 alpha-2)?
(Edited) There is a .NET API for ISO 3166-1, but for some reason they omitted the numeric code from .NET System.Globalization RegionInfo.
http://www.iso.org/iso/country_codes/ doesn’t list them either.
Spotted a Windows API –
EnumSystemGeoID
http://msdn.microsoft.com/en-us/library/dd374073(v=vs.85).aspx
but the numeric codes do not match the ISO numbers listed on wikipedia.
Mapping the three letter codes to an integer is not a bad idea, Martijn Coppoolse.
FOSS to the rescue?
https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes
That’s a nice find. We have our own enumerated type and an array of record with all the info in and currencies and languages. Been using it for years now, be good to have a standard source though