function toascii(s: string): string;
type
USASCIIString = type ansistring(20127);
begin
Result := USASCIIString(s);
end;
Using the above function I ran 24 files using this translation function.
The program produced 227 files (One per country).
Here is a list of the countries that did not translate:
Argentina.txt, Brazil.txt, Canada.txt, FaroeIslands.txt, Germany.txt, Iceland.txt, Italy.txt
Maldives.txt, Moldova.txt, Romania.txt, Thailand.txt, Tonga.txt, Uruguay.txt, Vietnam.txt
The 227 files have thousands of lines of data consisting of airport names cities states countries.
About 90 - 95 percent of the worlds airports.
I don't know what character sets it failed on. That is what character set dose Argentina have?
Actually I think that little 1 line function did fantastic.
@Thaddy
The text you refer to are airports in Guadeloupe. This is what I have in the TFile.txt and is put thru the translation. As you can see there are no non ASCII characters.
|*|Guadeloupe|3|City|Guadeloupe.txt|X|
TFFA (DSD)|La Desirade Airport|Beausejour|La Desirade
TFFB (BBR)|Baillif Airport|Baillif|Basse-Terre
TFFC (SFC)|Saint-Francois Airport|Saint-Francois|Grande-Terre
TFFM (GBJ)|Marie-Galante Airport|Grand-Bourg|Marie-Galante
TFFR (PTP)|Pointe-a-Pitre|Le Raizet Airport|Pointe-a-Pitre
This is what's was copied from
https://en.wikipedia.org/wiki/List_of_airports_by_ICAO_code:_TGuadeloupe Definately have non ASCII characters.
Also see airport category and list.
TFFA (DSD) – La Désirade Airport – Beauséjour, La Désirade
TFFB (BBR) – Baillif Airport – Baillif, Basse-Terre
TFFC (SFC) – Saint-François Airport – Saint-François, Grande-Terre
TFFM (GBJ) – Marie-Galante Airport – Grand-Bourg, Marie-Galante
TFFR (PTP) – Pointe-à-Pitre - Le Raizet Airport – Pointe-à-Pitre, Grande-Terre
TFFS (LSS) – Les Saintes Airport – Terre-de-Haut, Les Saintes
This is what is in my Guadeloupe.txt file. 'I Cant explain?'
|TFFA|DSD|La Desirade Airport|Beausejour|La Desirade|Guadeloupe|
|TFFB|BBR|Baillif Airport|Baillif|Basse-Terre|Guadeloupe|
|TFFC|SFC|Saint-Francois Airport|Saint-Francois|Grande-Terre|Guadeloupe|
|TFFM|GBJ|Marie-Galante Airport|Grand-Bourg|Marie-Galante|Guadeloupe|
|TFFR|PTP|Pointe-a-Pitre|Le Raizet Airport|Pointe-a-Pitre|Guadeloupe|
So Now I test winni function, but just on the following files. Argentina.txt, Brazil.txt, Canada.txt, FaroeIslands.txt, Germany.txt, Iceland.txt, Italy.txt, Maldives.txt, Moldova.txt, Romania.txt, Thailand.txt, Tonga.txt, Uruguay.txt, Vietnam.txt.