Новый улучшенный метод определения CP.
Добавленны ОС Mac

Код:
---- Улучшенный метод определения CP без загрузки внешнего файла ----
function getCodepage():String{
System.useCodepage = true;
var codePage:Array = new Array();
// windows 0xDE
codePage[0x0162] = 'windows-1250';
codePage[0x042E] = 'windows-1251';
codePage[0x03AE] = 'windows-1253';
codePage[0x0642] = 'windows-1256';
codePage[0x017D] = 'windows-1257';
codePage[0x0303] = 'windows-1258';
// 0xDE
codePage[0x0447] = 'koi8-r';
// mac 0xDE
codePage[0x0451] = 'mac-cyrillic';
codePage[0x03cc] = 'mac-greek';
codePage[0x0159] = 'mac-latin2';
codePage[0xFB01] = 'mac-roman';
// 0xDE->0xDE: 0xFE
codePage[0x02DB] = 'mac-iceland';
codePage[0x00FE] = 'windows-1252';
codePage[0x200F] = 'windows-1255';
// 0xDE->0x15E: 0xFD
codePage[0x0131] = 'windows-1254';
codePage[0x02DD] = 'mac-turkish';
var simbol:String = unescape('%DE%FE%FD');
var key:Number = simbol.charCodeAt(0);
switch (key) {
case 0xDE: key = simbol.charCodeAt(1); // get 0xFE
break;
case 0x15E: key = simbol.charCodeAt(2); // get 0xFD
break;
}
return codePage[key];
}
P.S. люди помогите протестить под ОС Mac и Linux
Если у кого стоят такие ОС прошу Вас протестить и высказать свое мнение или напишите мне PM.