Browse Source

ft: 代码调整

master
SisMaker 4 years ago
parent
commit
0ee4f5c5f2
1 changed files with 9 additions and 11 deletions
  1. +9
    -11
      src/eAcs.erl

+ 9
- 11
src/eAcs.erl View File

@ -136,7 +136,7 @@ getOutputIs(State) ->
replaceSw(BinStr) ->
TotalSize = byte_size(BinStr),
MatchBIMWs = doMatchRs(BinStr, TotalSize - 1, _Index = 1, _State = 0, _MatchList = []),
%io:format("IMY******************* ~p~n", [lists:reverse(MatchBIMWs)]),
io:format("IMY******************* ~p~n", [lists:reverse(MatchBIMWs)]),
doReplaceSw(lists:reverse(MatchBIMWs), BinStr, TotalSize, _StartPos = 0, <<>>).
%%
@ -162,9 +162,8 @@ getMatchWords(0, _BinStr, ByteIndex, _BslCnt, _Utf8Code, FilterWs) ->
{ByteIndex, FilterWs};
getMatchWords(MatchWordCnt, BinStr, ByteIndex, BslCnt, Utf8Code, FilterWs) ->
Byte = binary:at(BinStr, ByteIndex),
%io:format("IMY****************~p ~n", [Byte]),
if
Byte band 2#10000000 == 0 ->
Byte < 128 ->
%% ASCII
case acsSpw:getSpw(Byte) of
true ->
@ -174,22 +173,21 @@ getMatchWords(MatchWordCnt, BinStr, ByteIndex, BslCnt, Utf8Code, FilterWs) ->
%%
getMatchWords(MatchWordCnt - 1, BinStr, ByteIndex - 1, 0, 0, [?RW | FilterWs])
end;
Byte band 2#10000000 == 128 ->
Code = Byte band 2#00111111,
Byte band 128 == 128 ->
Code = Byte band 63,
getMatchWords(MatchWordCnt, BinStr, ByteIndex - 1, BslCnt + 6, Code bsl BslCnt + Utf8Code, FilterWs);
true ->
%io:format("IMY****************~p", [Byte]),
case BslCnt of
6 ->
Code = Byte band 2#00011111;
Code = Byte band 31;
12 ->
Code = Byte band 2#00001111;
Code = Byte band 15;
18 ->
Code = Byte band 2#00000111;
Code = Byte band 7;
24 ->
Code = Byte band 2#00000011;
Code = Byte band 3;
30 ->
Code = Byte band 2#00000001
Code = Byte band 1
end,
FullWord = Code bsl BslCnt + Utf8Code,
case acsSpw:getSpw(FullWord) of

Loading…
Cancel
Save