ngocthang26 Posted July 3, 2020 Share Posted July 3, 2020 Hi All I have problem How do conver string from Unicode to Character Original text ?q=Kim+lo%E1%BA%A1i Conver right ?q=Kim+loại I try method google but don't working. This website can work. But i hope can process direct Autoit. https://r12a.github.io/app-conversion/ Thanks so much All Link to comment Share on other sites More sharing options...
Musashi Posted July 3, 2020 Share Posted July 3, 2020 (edited) 1 hour ago, ngocthang26 said: Original text : ?q=Kim+lo%E1%BA%A1i Converted : ?q=Kim+loại Try this : Global $sOrig, $sConv $sOrig = "?q=Kim+lo%E1%BA%A1i" $sConv = _Decode($sOrig) MsgBox(BitOR(4096,64), "Conversion :", "Original " & $sOrig & @CRLF & "Converted " & $sConv) Func _Decode($sData) Local $aData = StringSplit($sData,"%") $sData = "" For $i = 2 To $aData[0] $aData[1] &= Chr(Dec(StringLeft($aData[$i],2))) & StringTrimLeft($aData[$i],2) Next Return BinaryToString(StringToBinary($aData[1],1),4) EndFunc @ngocthang26 EDIT : Show result in a MsgBox (not as ConsoleWrites) Edited July 3, 2020 by Musashi ngocthang26 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
ngocthang26 Posted July 3, 2020 Author Share Posted July 3, 2020 2 hours ago, Musashi said: Try this : Global $sOrig, $sConv $sOrig = "?q=Kim+lo%E1%BA%A1i" $sConv = _Decode($sOrig) MsgBox(BitOR(4096,64), "Conversion :", "Original " & $sOrig & @CRLF & "Converted " & $sConv) Func _Decode($sData) Local $aData = StringSplit($sData,"%") $sData = "" For $i = 2 To $aData[0] $aData[1] &= Chr(Dec(StringLeft($aData[$i],2))) & StringTrimLeft($aData[$i],2) Next Return BinaryToString(StringToBinary($aData[1],1),4) EndFunc @ngocthang26 EDIT : Show result in a MsgBox (not as ConsoleWrites) Working. Thanks you so much. ❤️ Link to comment Share on other sites More sharing options...
Malkey Posted July 3, 2020 Share Posted July 3, 2020 Another example. Local $sOrig = '?q=Kim+lo%E1%BA%A1i' MsgBox(0, "Conversion : ", "Original text: " & $sOrig & @CRLF & _ "Converted: " & BinaryToString(Binary(Execute('"' & StringRegExpReplace($sOrig, "(?i)%([0-9a-f]{2})", '" & Chr(0x${1})&"') & '"')), 4)) ; Returns:- ?q=Kim+loại Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now