NAto Phonetic Alphabet or ICAO phonetic
A complement and an errata (the Zero is not the last alphanumerical character but the first numerical).
Code:
<script type="text/javascript">
var Words={};
s="Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,Golf,Hotel,India,Juliet,Kilo,Lima,Mike,November,Oscar,Papa,Quebec,Romeo,Sierra,Tango,Uniform,Victor,Whiskey,X-Ray,Yankee,Zulu".split(/,/g);
for (var l=s.length,i=0;i<l;i++) Words[String.fromCharCode(i+97)]=s[i];
var t="Zero,One,Two,Three,Four,Five,Six,Seven,Eight,Niner".split(/,/g);
for (i=0;i<10;i++) Words[i]=t[i];
Words["-"]="Dash";
Words["."]="Dot";
Words[" "]="[space]";
var c='';
for (i in Words) c+=i+' => '+Words[i]+'\n';
// alert(c); just a test to see what you do
// A new method for Strings
String.prototype.toICAOPhonetic=function(){var i,l=this.length,r='';
that=this.toLowerCase();
for (i=0;i<l;i++) r+=' '+Words[that[i]];
return r;
}
// An example with KJFK
alert("JKFK".toICAOPhonetic());
</script>
KJFK (or Kilo Juliet Foxtrot Kilo) is the METAR code for New York John Fitzgerald Kennedy Airport. It gives the weather which it makes in newYork with this simple link.