Indigo Rose Software
Indigo Rose Software
Log in to the Customer Portal Customer Login
Software Development Discussion Forums Forums
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259

    Unicode Action Plugin

    Hello,

    I had some free time on my hands today, and decided to start coding a new action plugin. Here is the first release, very simple at this point (it may get some enhancements in the future - or not), but I think that it can help in a few cases.

    With this free action plugin, you will be able to import any Unicode or UTF-8 encoded text files into a string, which allows you to then process the information further using the Lua scripting engine. At the same time, the plugin allows you to save a string as a new Unicode or UTF-8 encoded text file.

    There are currently just two functions:
    Unicode.ReadToString(string Filename, string Encoding) and
    Unicode.WriteFromString(string Filename, string Text, string Encoding)

    Using the plugin, you may be able to read a Unicode text file directly, without having to convert it first with an external program, saving the converted file to disk and finally reading it into AutoPlay Media Studio (or Setup Factory, TrueUpdate or Visual Patch). The Unicode or UTF-8 encoded file will be converted into a ANSI (Latin-1) encoded string. Depending on the feedback, I might be going to add Unicode.ReadToTable(string Filename, string Encoding) and Unicode.WriteFromTable(string Filename, string Text, string Encoding) actions later, so the plugin would work similar to the standard TextFile actions.

    Here is the screen from the example project:

    The plugin and example project can be downloaded from my AMS page.

    Ulrich
    Last edited by Ulrich; 06-03-2009 at 09:48 PM.

  2. #2
    Join Date
    Oct 2007
    Location
    London, UK
    Posts
    1,283
    Nice one, This is something AMS should have always had.

  3. #3
    Join Date
    Feb 2005
    Posts
    56

    Thanks a lot

    Thanks, i've waited for this soooooo long, great and thanks again

  4. #4
    Join Date
    Apr 2009
    Posts
    277
    nice plugin, very useful, thanks

    any plan to include a function that can convert a ANSI string to Uni string for sending unicode arguments to dll files?

  5. #5
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    2,414
    Nice, thanks, I agree with shadow lol
    Code:
    Debug (((($2A<<8)!$FF04A0B)!$FF04A0B)>>8)
    ;> 42.
    If I & AMS <3 : Debug "Who doesn't love AMS?!" : EndIf ; You may guess the output.
    Bas Groothedde
    Imagine Programming :: Join my Forum Group for plugin news and updates.

    My AMS Plugins:

  6. #6
    Join Date
    Jan 2009
    Posts
    146
    WOW

    but, is posible add unicde.FileFind, Unicode.FileDoesExist, Unicode.FolderDoesExist, Unicode.SetLabelText (label, paragraf, button etc), Unicode.ReadINI actions?

    Or more better option; Unicode.StringConvert (for example conver one string with one path with one filename in unicode)

    Example:

    aa = INI.ReadValue(file, section, value (this in unicode or not))

    bb = Unicode.StringConvert(aa)

    result = Labet.SetText(namelabel, bb)

    THANKS
    Last edited by Tomasin; 06-04-2009 at 06:47 AM.

  7. #7
    Join Date
    Feb 2005
    Posts
    56

    Ams6

    Maybe a stupid question, but would it be possible to use this plug-in with AMS6??

    I hope to hear from you

  8. #8
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259
    Quote Originally Posted by Tomasin View Post
    Example:
    aa = INI.ReadValue(file, section, value (this in unicode or not))
    bb = Unicode.StringConvert(aa)
    result = Labet.SetText(namelabel, bb)
    This will not work. The unicode encoded string can not be passed along to the Lua environment. So, in your example, "aa" would already contain garbage, and there would be no way for Unicode.StringConvert() retrieve the ANSI equivalent of the original text. Instead, the plugin would need to read the INI file by itself, extract and convert the value to ANSI, so you could use it to set the text of the Label.

    Quote Originally Posted by Friethoe View Post
    Maybe a stupid question, but would it be possible to use this plug-in with AMS6??
    The plugin should work normally with AutoPlay Media Studio 6.0.

    Ulrich

  9. #9
    Join Date
    Jan 2009
    Posts
    146
    I need find.files in my system, but if the filename contain unicode caracters AMS retuns "????"... and with this FIle.DoesExis not work.

    If read one INI file for set text in specific label, button, paragraf, etc and the text contain unicode caracters, AMS not display the text (obvius... xD).

  10. #10
    Join Date
    Apr 2009
    Posts
    277
    Quote Originally Posted by upeters View Post
    This will not work. The unicode encoded string can not be passed along to the Lua environment. So, in your example, "aa" would already contain garbage, and there would be no way for Unicode.StringConvert() retrieve the ANSI equivalent of the original text. Instead, the plugin would need to read the INI file by itself, extract and convert the value to ANSI, so you could use it to set the text of the Label.

    Ulrich
    i take it the same goes for the DLL.CallUnicode

    i have attempted to write a dll that calls the unicode dll but it dont work unless its compiled with unicode enabled and thats really not much help.

  11. #11
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259
    Quote Originally Posted by MicroByte View Post
    i take it the same goes for the DLL.CallUnicode
    i have attempted to write a dll that calls the unicode dll but it dont work unless its compiled with unicode enabled and thats really not much help.
    Exactly. As you can't pass a string with Unicode encoding back to Lua, there is no way to use it as an argument for another function, like a call to a dll. I can use UTF-8 and Unicode inside the plugin, but I can't return the string with this encoding back to AMS (it would result in garbage, just like shown in the screen shot of the original post), it must be converted to ANSI first.

    For very the same reason, File.DoesExist() is impossible, because if you expect the function to return something, the search criteria (the parameter) would need to be Unicode. And how would you pass the parameter in this encoding when Lua does not support it? So the simple workaround is: do not use Unicode in the filename, or check for the DOS 8.3 equivalent.

    Ulrich

  12. #12
    Join Date
    Feb 2005
    Posts
    56

    Please help

    I still work with AMS6 and never worked with LUA. It's not available in my setting.

    I think I don't use the right terms to find out how to get a lua -plugin into my AMS6.

    Could someone guide me how to get things running, because I would really like to use this plugin (lua) with this great convertiontool for my projects.

    Information would be very welcome

  13. #13
    Join Date
    Oct 2008
    Location
    Romania
    Posts
    42
    Quote Originally Posted by upeters View Post
    This will not work. The unicode encoded string can not be passed along to the Lua environment. So, in your example, "aa" would already contain garbage, and there would be no way for Unicode.StringConvert() retrieve the ANSI equivalent of the original text.
    You are mistaken sir. Lua handles strings as a plain char*, a pointer to an array of bytes (be them signed or unsigned doesn't matter in this case). You can easily send UTF-8 through it, though don't exceptany string manipulation to work for anything but ASCII, as AMS assumes ASCII. Since AMS uses the ANSI version of the Windows API you might get a way by converting to the current locale encoding and displaying, and if the text is in that locale boom native language display. To make it work you'd have to either replace the Lua engine or umm... replace the whole AMS API.

  14. #14
    Join Date
    Feb 2005
    Posts
    56
    Quote Originally Posted by Friethoe View Post
    I still work with AMS6 and never worked with LUA. It's not available in my setting.

    I think I don't use the right terms to find out how to get a lua -plugin into my AMS6.

    Could someone guide me how to get things running, because I would really like to use this plugin (lua) with this great convertiontool for my projects.

    Information would be very welcome
    Okay, found it, at last

    Ulrich, thanks again!

  15. #15
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259
    I added two new functions to the plugin, now at version 1.0.2.0:

    Unicode.ReadToTable(string Filename, string Encoding) and
    Unicode.WriteFromTable(string Filename, table Text, string Encoding).

    Ulrich

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Indigo Rose Software