User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Reading a Unicode text file?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reading a Unicode text file?

    I'm trying to simply load a UTF-8 encoded text file into MMF2, however it still seems to display it with ANSI encoding.

    I have this simple code for a textbox:

    "start of frame - load text file 'book.txt'"

    and it displays — and “ as â€.

    If I manually edit a string to have these characters, they display normally, but I can't find a way to load textfiles that read them properly. I noticed that these characters even work in the normal version of MMF2 anyway. I know that my font supports these characters.

    How do I get a text file to load and display these characters?

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,807
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    UTF-8 and ANSI are the same until you reach the bytes worth 128+.
    It's likely the open command doesn't specify the encoding to be utf-8, in which case the object will need to be rewritten.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've tried the Edit object, File Stream and the List object and none of them work!

    I'm finding this quite frustrating because I bought Unicode MMF with the intention of being able to read Unicode characters!

    Are there any extensions which can read large UTF-8 encoded text files (or otherwise specify the encoding) and display them somehow in MMF?

  4. #4
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    5,898
    Mentioned
    116 Post(s)
    Tagged
    2 Thread(s)
    Hi,

    sorry to bump here.

    did you try to use webview?

    I will like to mention that some UTF-8 files downloaded or taken from the web using Chrome or Firefox are diferent.

    http://www.cl.cam.ac.uk/~mgk25/ucs/e...UTF-8-demo.txt

    in this link you will find a demo file if you download using chrome or firefox this is not going to work but if you download using IE you will see that works correctly, if you use from internet directly it will always works .

    also i add both files see (in a HexEditor i am using HxD ***free***) one start with the unicode byte mark (IE ===> EF BB BF) and for Chrome and Firefox NO (a single 0A).

    Hope it helps


    EDIT: i see you have developer you may use web control object.
    Attached files Attached files
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I opened your example .mfa but it crashed when I tried to open a file. I didn't have the WebView extension, and your program required "Webview2.mfx" which I thought may have been a duplicate?

    I know that my text files are encoded as UTF-8. If I open the two sample files that you included with Notepad++, it detects the encoding of one as ANSI and the other UTF-8, as you said. Similarly, with my own text file, it detects it as UTF-8.

    Is webview able to display UTF-8 encoded files properly on Windows?

  6. #6
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    5,898
    Mentioned
    116 Post(s)
    Tagged
    2 Thread(s)
    WebView2 is the correct name this object have the same name as the one from iOS.

    here is the link

    http://community.clickteam.com/showthread.php?t=68655&highlight=webview

    but since you have developer use web control object more powerful, when you open a document that is signed in UTF-8 using the menu you will see the encoding also you may read the encoding using the extension.

    webview and web control object can show correctly the UTF-8 on windows.
    Attached files Attached files
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I installed the version of the extension that you specified, however when I run the example, first the .exe crashes due to "KcWebX.mfx", and then MMF itself crashes, also due to "KcWebX.mfx"

    I'm using MMF2 Dev Beta 3 after build 254 and Windows 7 64-bit.

    Thanks for taking the time to try and help though.

    Ideally what I'm trying to do is simply display a sentence from a UTF-8 text file, word by word, in a very large font on-screen.

  8. #8
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    12,830
    Mentioned
    82 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by netninja View Post
    I've tried the Edit object, File Stream and the List object and none of them work!
    I've just tried the Edit and List objects, they can load Unicode text files...

    These files must start with a special mark that says how they are encoded. Save Unicode text files with Notepad to see what I mean.

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,807
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    That mark is known as BOM (Byte Order Mark), but it is not necessary to include it Yves, you can use the "wb, encoding=..." instead of just "wb" in the fopen() call.
    http://msdn.microsoft.com/en-us/library/yeby3zcb.aspx

    You can add the UTF-8 BOM mark by prepending 3 bytes with values 0xEF 0xBB 0xBF to the start of the file. In decimal terms, that's 3 bytes, 239 187 191. You can add it with the Binary object. Or a CT dude could add that functionality to an extension

  10. #10
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    5,898
    Mentioned
    116 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by netninja View Post
    I installed the version of the extension that you specified, however when I run the example, first the .exe crashes due to "KcWebX.mfx", and then MMF itself crashes, also due to "KcWebX.mfx"

    I'm using MMF2 Dev Beta 3 after build 254 and Windows 7 64-bit.

    Thanks for taking the time to try and help though.

    Ideally what I'm trying to do is simply display a sentence from a UTF-8 text file, word by word, in a very large font on-screen.
    perfect you may use the web object and after that use the find text features and send to clipboard after that you may use inside string or edit box.

    download the object from my web page, the last version is 3.1u
    Regards,


    Fernando Vivolo

    ... new things are coming ...

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Text Reading And Editing
    By variant in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 7th November 2009, 07:09 PM
  2. Reading a text- or csv file - possible?
    By Tiny in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th July 2009, 01:23 PM
  3. reading a text file for lots of data (help?)
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 19th June 2008, 12:24 PM
  4. Reading from a text file.
    By Conno in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 31st May 2008, 06:01 AM
  5. Reading text from file
    By KenTankerous in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th March 2007, 08:30 PM

Posting Permissions

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