Results 1 to 5 of 5

Thread: Console output differs from instruction

  1. #1
    Member DirectuX's Avatar
    Join Date
    Oct 2018
    Location
    France
    Posts
    417
    Rep Power
    55

    Exclamation Console output differs from instruction

    Please, can someone confirm ?

    uses "console"
    
    printl Console_GetCP ' Outputs 850
    printl " °C " ' Outputs  ┬░C 
    
    WaitKey
    
    ThinBasic 1.11.6.0 ALPHA
    Font is "Consolas" and has support for the characters needed.
    Changing font to "Deja vu" doesn't solve the issue.
    Changing codePage to 1252 or 65001 doesn't solve the issue.
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    Hi DirectuX,

    the issue is in fact thinBASIC strings are now UTF8 encoded.

    You can workaround it like:
    uses "console"
     
    printl Console_getCP ' Outputs 850
    printl " " + chr$(248) + "C "
     
    WaitKey
    
    There is yet a mountain of work to make UTF8 work across various corners of thinBASIC.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Member DirectuX's Avatar
    Join Date
    Oct 2018
    Location
    France
    Posts
    417
    Rep Power
    55

    Talking

    Ah-ha!
    Thanks Petr !
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10
    Forcing output code page to UTF8 can help.
    Put the following at the beginning of the script

    Console_SetOutputCP(%CP_UTF8)
    
    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

  5. #5
    Member DirectuX's Avatar
    Join Date
    Oct 2018
    Location
    France
    Posts
    417
    Rep Power
    55

    Thumbs up

    Quote Originally Posted by ErosOlmi View Post
    Forcing output code page to UTF8 can help.
    Put the following at the beginning of the script

    Console_SetOutputCP(%CP_UTF8)
    
    Quote Originally Posted by DirectuX View Post
    Changing codePage to 1252 or 65001 doesn't solve the issue.
    Thanks Eros, it didn't work first because I was using Console_SetCP function instead.

    Note: %CP_ built-in constants are not listed in the help file.
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

Similar Threads

  1. Replies: 10
    Last Post: 08-03-2018, 18:53
  2. Quote Of the Day Guess the output (Union)
    By ErosOlmi in forum QOD: Question Of the Day
    Replies: 3
    Last Post: 09-02-2013, 10:08
  3. Quote Of the Day Different output?
    By ErosOlmi in forum QOD: Question Of the Day
    Replies: 2
    Last Post: 08-02-2013, 09:44
  4. Capturing OS_ShellExecute Output?
    By mhillmer in forum Console
    Replies: 4
    Last Post: 13-09-2007, 17:34

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

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