0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

文字列からutf16コードを表示するだけのプログラム

Posted at

ちょっと必要になったのでAIを使って書いた。

moji2utf16.ahk
#Persistent
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

Gui, Add, Edit, w300 vInputText, 入力してください
Gui, Add, Button, gShowCode, コード変換
Gui, Add, Edit, w300 ReadOnly vCodeBox, ここにUTF-16コードが表示されます
Gui, Add, Button, gCopyCode, コピー
Gui, Show,, UTF-16 コード変換ツール
Return

ShowCode:
Gui, Submit, NoHide
UTF16Code := ""
Loop, Parse, InputText
{
    Char := SubStr(A_LoopField, 1, 1) ; 1文字ずつ取得
    UTF16 := "{U+" . Format("{:04X}", Asc(Char)) . "}" ; U+を付けてUTF-16形式に変換
    UTF16Code .= UTF16 . " "
}
GuiControl,, CodeBox, %UTF16Code%
Return

CopyCode:
Gui, Submit, NoHide
Clipboard := UTF16Code
MsgBox, UTF-16コードがコピーされました!
Return

GuiClose:
ExitApp
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?