If you actually look at the code, you'll see that the representation of the result is only an example. The function converts ANSI data to Unicode data in a Lua string (which supports null characters). HTTP.Submit or any other AMS function usually do not support unicode data, so you'll need something else (WinAPI).
If you don't understand this small piece of code, I'm not sure how to help you further.
Announcement
Collapse
No announcement yet.
Ansi to Unicode DLL
Collapse
X
-
Originally posted by Imagine Programming View PostSimple answer:
Code:String.AnsiToUnicode = function(s) local res = nil; local len = s:len(); local new = (len * 2) + 2; local buf = MemoryEx.AllocateEx(new); if(buf)then buf:String(len, MEMEX_UNICODE, s); res = buf:LString(new); buf:Free(); end return res; end;
Code:Debug.ShowWindow(); local test = String.AnsiToUnicode("Hello World!!"); for i = 1, test:len() do local charCode = test:byte(i); Debug.Print(charCode.."\r\n"); end
I want to convert ANSI to Unicode for use in HTTP.Submit function to sent it to a php file.
But your example convert ANSI to strings like Number. I can't use this, I don't need Unicode number.
Can I Convert My String to a Readable Unicode or UTF-8?
My string contain Arabic or Persian Characters.
Leave a comment:
-
-
Simple answer:
Code:String.AnsiToUnicode = function(s) local res = nil; local len = s:len(); local new = (len * 2) + 2; local buf = MemoryEx.AllocateEx(new); if(buf)then buf:String(len, MEMEX_UNICODE, s); res = buf:LString(new); buf:Free(); end return res; end;
Code:Debug.ShowWindow(); local test = String.AnsiToUnicode("Hello World!!"); for i = 1, test:len() do local charCode = test:byte(i); Debug.Print(charCode.."\r\n"); end
Leave a comment:
-
-
-
I want to send SMS with HTTP web service.
But my service provider doesn't support ANSI and I must convert it to Unicode.
Can you find a Plugin or DLL file or... to convert ANSI to Unicode???
I need this.
Leave a comment:
-
-
Originally posted by Shrek View PostWhat is it your doing with Unicode strings? I ask as there is a couple of plugins that are supported that deal with Unicode should you not get this DLL.
Leave a comment:
-
-
What is it your doing with Unicode strings? I ask as there is a couple of plugins that are supported that deal with Unicode should you not get this DLL.
Leave a comment:
-
Leave a comment: