ahk-chardet Detect File/Var Encoding
Posted: 09 Dec 2023, 02:02
base on uchardet.dll v0.0.8 and swagfag 's code, i create a lib ahk-chardet.
hope it helps someone in need.![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
usage:
hope it helps someone in need.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
usage:
Code: Select all
MsgBox % FileGetCodePageByBom("test\fr\utf-16.be") ; 1201
MsgBox % FileGetCharset("test\ja\iso-2022-jp.txt") ; ISO-2022-JP
MsgBox % FileGetCodePage("test\ja\iso-2022-jp.txt") ; 50220
FileRead binary, *c test\ja\iso-2022-jp.txt
MsgBox % VarGetCharset(binary) ; ISO-2022-JP
MsgBox % VarGetCodePage(binary) ; 50220
ExitApp
#Include Lib\uchardet.ahk