Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
An interesting side effect of interaction between QB64PE and Windows
#1
I wanted to create a list of the QB/QB64 box-drawing characters that are emulated in the bytes above 127. But, what you see on screen may not be what you get from Windows.

I wrote a program to show all the different combinations of boxes one can create with the QB character set from Windows code page 437. So look at the following program, which modifies itself. Try loading and running this from the same directory that it is saved to.


.bas   box_drawing.bas (Size: 1.77 KB / Downloads: 38)

Run this program from the QB64/QB64PE IDE, and notice the line drawing characters shown on screen? Using standard cmd copy/paste methods, hi light the text, then press enter to copy them. Try pasting them onto your screen, you get garbage. I suspected that intra-program copy/paste would work, but not between programs. So I added an INPUT statement and a print of what was typed.

But now, try reloading the program from disk, and the characters it posted to itself are what you would expect.

This confirmed what I suspected. When copy/paste in the same program, they can use any format for text. Transferring text from one program to another, I suspect Windows probably expects UTF-8 (or UTF-16) and if not there, it produces junk.

I found this quite amusing.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#2
True, UTF-8. I recall some output as the Windows "I don't know!" character, but that post was too long ago for my aged memory to recapture.

Pete


Reply




Users browsing this thread: 1 Guest(s)