trainer Posted August 26, 2009 Posted August 26, 2009 (edited) Hi there, maybe someone can help?I'm trying to convert a string into the UTF16 format. In php I can use a function like this:function Str2Utf16($string) { $string = iconv("ISO-8859-1", "UTF-16", $string); return substr($string, 2, strlen($string)-2);In VBA there seems to be no need to convert the string - but AutoIt (even though I'm using v. 3.3.0.0) seems to handle the string as UTF8, just like php.Why do I need this?I'm trying to send a http-Request to the AVM Fritzbox 7270 in order to log in to the webinterface. Therefore I need to construct a string in the UTF-16-LE format (without BOM and final zero-bytes). Details: http://www.avm.de/de/Extern/Technical_Note_Session_ID.pdfI already tried something like this: (found within another post in this forum: http://www.autoitscript.com/forum/index.php?showtopic=92061&st=0&p=662436&hl=utf16&fromsearch=1&), but this doesen't work for me >_<; string conversion: UTF-8 --> UTF-16 Func _Utf8ToUtf16($Utf8String) Local $struct = _WinAPI_MultiByteToWideChar($Utf8String, 65001) Return($struct) EndFuncThanx for any replies an helptrainer Edited August 26, 2009 by trainer
GodlessSinner Posted August 27, 2009 Posted August 27, 2009 Taken from help_file:StringToASCIIArray( "string", [ start [, end [, encoding ] ] ] )encoding [optional] The returned array will contain values in the specified character set:0 - UTF-16 (Default)1 - ANSI2 - UTF-8 #include <Array.au3> ; For _ArrayDisplay() Local $a = StringToASCIIArray("abc") _ArrayDisplay($a) _____________________________________________________________________________
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