|
|
@ -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 |
|
|
|