#include #include $gui=GUICreate("Character codes",200,60) $chars=GUICtrlCreateInput("",0,0,200,20) $codes=GUICtrlCreateInput("",0,41,200,20) $asc=GUICtrlCreateRadio("ASCII",30,21,50,20) $ascw=GUICtrlCreateRadio("Unicode",111,21,1000,20) GUICtrlSetState($asc,$GUI_CHECKED) GUISetState() $lastchars="" $lastcodes="" While 1 $msg = GUIGetMsg() Select Case GUICtrlRead($chars)<>$lastchars $string=GUICtrlRead($chars) $string=StringSplit($string,'',2) $output="" $ascii=BitAND(GUICtrlRead($asc), $GUI_CHECKED) For $symbol In $string If $ascii Then $output&=Asc($symbol)&" " Else $output&=AscW($symbol)&" " EndIf Next GUICtrlSetData($codes,$output) $lastchars=GUICtrlRead($chars) $lastcodes=GUICtrlRead($codes) Case GUICtrlRead($codes)<>$lastcodes $string=GUICtrlRead($codes) $string=StringSplit($string,' ',2) $output="" $ascii=BitAND(GUICtrlRead($asc), $GUI_CHECKED) For $symbol In $string If $ascii Then $output&=Chr($symbol)&" " Else $output&=ChrW($symbol)&" " EndIf Next GUICtrlSetData($chars,$output) $lastchars=GUICtrlRead($chars) $lastcodes=GUICtrlRead($codes) Case $msg = $asc Or $msg = $ascw $lastchars="" $lastcodes="" Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Exit