Func _Encoding_GetCyrillicANSIEncoding($sLine)
; Local $vTag,$n=0,$k=0,$j=0,$R=0,$aRet=StringSplit($sLine,'')
; For $i=1 To $aRet[0]
; $vTag=Asc($aRet[$i])
; Switch $vTag
; Case 192,224,200,232,206,238,210,242 ; АаИиОоТт
; $n+=1
; Case 128,160,136,168,142,174,146 ; Ђ €ЁЋ®’
; $k+=1
; Case 225,193,233,201,239,207,244,212 ; бБйЙпПфФ
; $j+=1
; Case 176,208,184,216,190,222,194 ; °РёШѕЮВ
; $R+=1
; Case 226 ; в
; $k+=1
; $R+=1
; EndSwitch
; Next
Local $n,$k,$j,$R
StringRegExpReplace($sLine,'(?i)[аиот]',0)
$n=@extended
StringRegExpReplace($sLine,'[Ђ €ЁЋ®’]',0)
$k=@extended
StringRegExpReplace($sLine,'(?i)[бйпф]',0)
$j=@extended
StringRegExpReplace($sLine,'[°РёШѕЮВ]',0)
$R=@extended
StringRegExpReplace($sLine,'в',0)
$k+=@extended
$R+=@extended
If $j>=$n And $j>$k And $j>$R Then Return 'KOI8-R'
If $n>$j And $n>$k And $n>$R Then Return 'WINDOWS-1251'
If $k>$j And $k>$n And $k>$R Then Return 'IBM-866'
If $R>$n And $R>$k And $R>$j Then Return 'ISO-8859-5'
Return ''
EndFunc