Announcement

Collapse
No announcement yet.

Ansi to Unicode DLL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Imagine Programming
    replied
    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.

    Leave a comment:


  • mslight13
    replied
    Originally posted by Imagine Programming View Post
    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;
    Simple example
    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
    Thank you so much for this Example.
    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:


  • Imagine Programming
    replied
    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;
    Simple example
    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:


  • mslight13
    replied
    How can I use MemoryEx to Convert String?

    Leave a comment:


  • Shrek
    replied


    Leave a comment:


  • mslight13
    replied
    No anyone to help me?

    Leave a comment:


  • mslight13
    replied
    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:


  • Shrek
    replied
    Hi there :yes

    Leave a comment:


  • kingzooly
    replied
    Originally posted by Shrek View Post
    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.
    That DLL is form days of old also might be hard to find that but ya what you trying to do might be a simple work around for what your trying to do, and hey Shrek its been sometime

    Leave a comment:


  • Shrek
    replied
    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:


  • mslight13
    started a topic Ansi to Unicode DLL

    Ansi to Unicode DLL

    Hi all,
    I need a DLL like this:


    Please give me this.
    Thanks.
Working...
X
😀
🥰
🤢
😎
😡
👍
👎