일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- NUGU
- esbuild
- Malware Sample
- 네이버카페
- CJ대한통운 #쿠팡 #통관번호오류 #통관고유번호오류 #안주원팀장 #모건인베스트
- open redirect
- 허리디스크
- 안전결제
- 보이스피싱 #대검찰청 #명의도용 #비밀번호 #계좌번호 #공공기관 #가짜검찰청
- CryptoJS
- 많다..
- intelmac
- 변태는
- ue4dumper
- XSS
- 취약점
- MongoDB #NoSQL #CreateUser #DropUser #mongod #mognod.conf
- ssrf
- speed-measure-webpack-plugin
- shell_gpt
- 모의해킹
- Frida
- 거래사기
- 척추관협착증
- Sequoia
- react
- 중고나라
- 로맨스스캠
- self-signed
- 채팅환전사기
- Today
- Total
annyoung
[AutoHotKey Header] UTF8Encode, UTF8Decode.ahk 본문
|
UTF8encode(Str, Enc = "UTF-8") { StrPutVar(Str, Var, Enc) f := A_FormatInteger SetFormat, IntegerFast, H Loop { Code := NumGet(Var, A_Index - 1, "UChar") If (!Code) Break If (Code = 0x21 || Code = 0x27 || Code = 0x28 || Code = 0x29 || Code = 0x2A || Code = 0x2D || Code = 0x2E || Code >= 0x30 && Code <= 0x39 ; 0-9 || Code >= 0x41 && Code <= 0x5A ; A-Z || Code = 0x5F || Code = 0x7E || Code >= 0x61 && Code <= 0x7A) ; a-z Encoded .= Chr(Code) Else Encoded .= "%" . SubStr(Code + 0x100, 4) } SetFormat, IntegerFast, %f% Return, Encoded }
UTF8Decode(Str, Enc = "UTF-8") { Loop { If (!RegExMatch(Str, "i)(?:%[0-9a-f]{2})+", Code)) Break VarSetCapacity(Var, StrLen(Code) / 3, 0) StringTrimLeft, Code, Code, 1 Loop, Parse, Code, `% NumPut("0x" . A_LoopField, Var, A_Index - 1, "UChar") StringReplace, Str, Str, `%%Code%, % StrGet(&Var, Enc), All } Return, Str }
StrPutVar(Str, ByRef Var, Enc = "") { Size := StrPut(Str, Enc) * (Enc = "UTF-16" || Enc = "CP1200" ? 2 : 1) VarSetCapacity(Var, Size, 0) Return, StrPut(Str, &Var, Enc) } |
Description : UTF-8로 인코딩하거나 UTF-8을 디코딩하기 위한 함수입니다. AHK_B, AHK_L 모두 사용 가능한 함수입니다. |
'프로그래밍' 카테고리의 다른 글
Microsoft-IIS/6.0 webdav remote authentication bypass scanner v0.1 (0) | 2014.03.28 |
---|---|
[AutoHotKey Header] EUC-KR Encode, Decode.ahk (15) | 2014.03.14 |
[AutoHotKey Header] MD5.ahk (0) | 2014.03.14 |
[AutoHotKey Header] COM.ahk (0) | 2014.03.14 |
[AutoHotKey Header] SendH.ahk (0) | 2014.03.14 |