Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Is this ASCII, ANSI, UNICODE or something else?

  1. #1
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Is this ASCII, ANSI, UNICODE or something else?

    Dear Thinbasic experts,

    If I run the code below, It outputs wrong characters (Í ÷ &#218. How can I display the correct characters?

    uses "console"
    printl "Ö ö é"
    console_waitkey


    if I use MSGBOX instead of PRINTL everything is displayed correct, but I want this to display correct in a console too.

    Thanks in advance for your help

    Martin

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Is this ASCII, ANSI, UNICODE or something else?

    Martin,

    we are checking. From the tests we are making it seems we have a problem in the compiler we are using.
    We are making further testing and if confirmed we will send a request to our compiler support help desk.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Is this ASCII, ANSI, UNICODE or something else?

    Thanks for letting me know Eros. It also doesn't work correctly with FILE_LinePrint. But maybe I can temporarely solve that by replacing those characters with others.

    Greetings,

    Martin

  4. #4
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Is this ASCII, ANSI, UNICODE or something else?

    whoohoo it seems to work fine with saving in Binary mode, so I can use that.

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Is this ASCII, ANSI, UNICODE or something else?

    Martin,

    our supposition is that problem seem definitely in compiler and how it treats string literals constants (strings inside double quotes).
    It seems to apply always code page 1252 instead of the local code page, in my case 850.

    I'm not 100% sure about the above, we are still testing but from all our tests it seems confirmed.

    We also think to have found a work around that is to load source code as ascii, transform it into unicode and back to ascii but now forcing code page 850. So when thinBasic loads source code files it will now perform something like:
    [code=freebasic]ScriptSourceCode = ACode$(UCode$(ScriptSourceCode), 850)[/code]

    _________________________________________________
    Can you please test thinCore.dll and see if it solves the problem?
    You need latest thinBasic beta 1.7.8.0 installed.
    Than keep attached thinCore.dll and place it in \thinBasic\ directory replacing your current one.

    If than you can confirm if this solves the problem we can definitely send a support request to Power Basic.
    If this thinCore.dll does not resolve the problem we have to search somewhere else.

    Thanks
    Eros

    PS: attention, with this thinCore.dll you cannot create correct bundled exe but you have to wait next thinBasic update.
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Is this ASCII, ANSI, UNICODE or something else?

    Hi Again,

    I replaced the corefile and then checked only these evil characters: Ö, ö and é but it doesn't solve the problem 

    In the console it displays:
    Ö as ö (lowercase)
    ö as " (which generate an error: "Unrecognized or unsupported char")
    é correctly as é

    With FILE_LinePrint:
    The same problem with ö ("Unrecognized or unsupported char")
    Ö is converted to
    and é to

    I hope this information is helpfull to you.

    Martin

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Is this ASCII, ANSI, UNICODE or something else?

    Martin,

    forget my previous post with thinCore.dll

    Can you please try to add the following line to the script:

    [code=thinbasic]console_setoutputcp(1252)[/code]

    And see what happen?

    Thanks
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Is this ASCII, ANSI, UNICODE or something else?

    Ciao Eros, I did but I still get wrong output

  9. #9
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Is this ASCII, ANSI, UNICODE or something else?

    Here that line solves the problem

    Can you please check with code page you have as default one?
    You can do that using something like:
    [code=thinbasic]
    USES "CONSOLE"
    printl console_Getoutputcp
    waitkey
    [/code]
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  10. #10
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: Is this ASCII, ANSI, UNICODE or something else?

    the result of console_Getoutputcp is: 850

Page 1 of 2 12 LastLast

Similar Threads

  1. HELP FILE : Unicode information swapped
    By Michael Clease in forum Fixed or cleared errors in help material
    Replies: 1
    Last Post: 09-03-2011, 12:19

Members who have read this thread: 1

Posting Permissions

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