예지력
W
예지력

블로그 메뉴

  • 문의 & 피드백
  • GitHub
  • 분류 전체보기
    • 주식
    • 파생상품
    • crypto
      • 차트에 현대미술
      • 복기
      • 시스템 트레이딩
      • 기술적 분석
      • 블록체인
      • 생각
      • 리서치
      • Token Engineering
    • 이더리움 | ETH
      • 리서치
    • 테라 | LUNA
      • Tefi
      • 루나 LUNA
      • 아스트로포트 Astro
      • 앵커 프로토콜 ANC
      • 미러 프로토콜 MIR
      • 아폴로 다오 APOLLO
      • 프리즘 프로토콜 PRISM
      • 넥서스 프로토콜 NEXUS
      • 레바나 프로토콜 LEV
      • 마스 프로토콜 MARS
      • 더비 스타즈 Derby Stars
    • 프로그래밍
      • AHK 메뉴얼
      • AHK 레퍼런스
      • Delphi XE7
      • C
      • Python
      • Reversing
      • Archive
    • 일상
    • 영화
    • 낙서장
    • Deprecated
      • 로다 플레이어
      • 어의

인기 글

최근 댓글

전체 방문자
오늘
어제

티스토리

hELLO · Designed By 정상우.
예지력

W

오토핫키 (.ahk) 유니코드 인코딩 변환기!
프로그래밍/Archive

오토핫키 (.ahk) 유니코드 인코딩 변환기!

2015. 1. 9. 04:13


.ahk 파일을 메모장으로 열어서 '유니코드' 또는 'UTF-8'로 저장해주지않으면 소스 작성시 한글이 꺠집니다.

그래서 외국포럼에서 소스코드를 받아 수정할때 저 번거로운 작업을 거쳐야했는데요.


스크립트 수정툴인 AHK Studio 으로 스크립트 수정시 한글이 깨져서 관련파일을 전부 유니코드로 바꿔야하는데..

파일수가 120 개정도 되더라구요 ;; 답이 없어서 한번에 인코딩 변환하는 툴을 제작해보았습니다.


드래그&드롭을 지원해서 스크립트파일을 드래그해서 박스에 드롭해도되고,

변환해야할 스크립트가 많다면 '파일 불러오기' 클릭후에 '전부변환' 누르시면 됩니다!




 

유니코드 변환기.zip

 

ahk.org 에 발전된 소스코드 올렸습니다.

 



#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
#SingleInstance force
#NoTrayIcon
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

nb = 1
MsgBox, 4160, 중요한 정보, 변환할 스크립트(.ahk) 파일이 있는 경로에서 실행하셔야합니다!
Gui, add, edit, xm+420 ym w400 h260 vStrIn, 변환될 소스코드`n드래그드롭가능해요
;Gui, add, edit, xm y+30 w500 h200 vStrOut, Changed
Gui, add, ListView, xm ym w400 h260 vmyListView gAHKlist AltSubmit, 파일명|경로
Gui, add, button, xm+420 ym+265 w100 h30, 개별변환
Gui, add, button, xm ym+265 w100 h30 gAHKget, 파일 불러오기
Gui, add, button, xm+120 ym+265 w100 h30, 전부변환
LV_ModifyCol(1, 150)
LV_ModifyCol(2, 230)
Gui, show, Autosize, 스크립트 인코딩 변환기 by 예지력(knowledgeisfree.tistory.com)
return

AHKget:
LV_DELETE()
Loop, %A_ScriptDir%\*.ahk
{
    Howmuch := A_Index
    File%A_Index% := A_LoopFileName
    LV_Add("", A_LoopFileName, A_LoopFileDir)
}
Gui, +OwnDialogs
MsgBox, 4160, , % Howmuch "개의 스크립트를 불러왔습니다!"
return

AHKlist:
Gui,Submit,NoHide
if (lv_getcount() > 0)
{
if A_GuiEvent = DoubleClick
{
    StrIn := ""
    GuiControl,, StrIn,
    LV_GetText(ThisName, A_EventInfo, 1)
    FileRead, Opt2, %ThisName%
    GuiControl,, StrIn, %Opt2%
}
}
return

Button전부변환:
Gui,Submit,NoHide
while nb <= LV_GetCount()
{
    StrIn := ""
    GuiControl,, StrIn,
    LV_GetText(TrueName, A_Index)
    FileRead, Opt2, %TrueName%
    GuiControl,, StrIn, %Opt2%
    FileDelete, %TrueName%
    FileAppend, %Opt2%, %TrueName%, UTF-16
    MsgBox % TrueName "완료"
    nb ++
}
nb := 1
return

Button개별변환:
Gui, Submit, NoHide
FileDelete, %FileName%
StringReplace, op1, FileName, %A_ScriptDir%\,, All
FileAppend, %StrIn%, %op1%, UTF-16
return

GuiDropFiles:
FileEncoding, UTF-8
StrIn := ""
GuiControl,, Strin,
if A_GuiControl = StrIn
{
    FileName := A_GuiEvent
    FileRead, Draged, %A_GuiEvent%
    GuiControl,, StrIn, %Draged%
}
return

GuiClose:
ExitApp


728x90
저작자표시 비영리 동일조건 (새창열림)

'프로그래밍 > Archive' 카테고리의 다른 글

Scrollable image list  (0) 2015.01.23
SetHoverText - Change control's text on mouseover  (1) 2015.01.23
PleasantNotify 미려한 팝업메시지  (0) 2015.01.22
USkin.dll and .msstyles  (0) 2015.01.08
Official release  (0) 2014.12.28
    '프로그래밍/Archive' 카테고리의 다른 글
    • SetHoverText - Change control's text on mouseover
    • PleasantNotify 미려한 팝업메시지
    • USkin.dll and .msstyles
    • Official release
    예지력
    예지력

    티스토리툴바