From 0ee4f5c5f2db8ed8f42d52d280771d37a922be1a Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Thu, 29 Apr 2021 18:21:19 +0800 Subject: [PATCH] =?UTF-8?q?ft:=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eAcs.erl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/eAcs.erl b/src/eAcs.erl index 3b4a479..006482c 100644 --- a/src/eAcs.erl +++ b/src/eAcs.erl @@ -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