Juno_okyo

Encode String (UTF-8)

Aug 25th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.52 KB | None | 0 0
  1. ;~ Coded by Juno_okyo
  2.  
  3. Func _encodeUnicode($str)
  4.     Local $aStr = StringSplit($str, ''), $output = ''
  5.  
  6.     For $i = 1 To $aStr[0]
  7.         ; Split char for decode function
  8.         If $i > 1 Then $output &= Chr(Random(58, 126, 1))
  9.         $output &= AscW($aStr[$i])
  10.     Next
  11.  
  12.     Return $output
  13. EndFunc   ;==>_encodeUnicode
  14.  
  15. Func _decodeUnicode($str)
  16.     Local $aStr = StringRegExp($str, '[0-9]+', 3)
  17.     If @error Then Return $str
  18.  
  19.     Local $output = ''
  20.  
  21.     For $n In $aStr
  22.         $output &= ChrW($n)
  23.     Next
  24.  
  25.     Return $output
  26. EndFunc   ;==>_decodeUnicode
Add Comment
Please, Sign In to add comment