QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Ryster on September 02, 2021, 02:51:33 pm
-
Hello.
Maybe someone will look at the code. Well, it shows me two letters instead of one under the CHR $ code (136).
Thanks
IF unicode&
= 0 THEN unicode&
= 9744 PRINT " ----------------------------------------------------" PRINT " Program do obliczania element" + CHR$(162) + "w odcinka ko" + CHR$(136) + "owego" PRINT " ----------------------------------------------------" Microsoft_pc_cp852:
DATA 199,252,233,226,228,367,263,231,322,235,336,337,238,377,196,262 DATA 201,313,314,244,246,317,318,346,347,214,220,356,357,321,215,269 DATA 225,237,243,250,260,261,381,382,280,281,172,378,268,351,171,187 DATA 9617,9618,9619,9474,9508,193,194,282,350,9571,9553,9559,9565,379,380,9488 DATA 9492,9524,9516,9500,9472,9532,258,259,9562,9556,9577,9574,9568,9552,9580,164 DATA 273,272,270,203,271,327,205,206,283,9496,9484,9608,9604,354,366,9600 DATA 211,223,212,323,324,328,352,353,340,218,341,368,253,221,355,180 DATA 173,733,731,711,728,167,247,184,176,168,729,369,344,345,9632,160 PrintIt a$
-
Now its writed in Polish correctly. You can writining directly your nationals characters usin Polish keyboard to IDE, in IDE is then this text not displayed correctly, BUT with _MAPUNICODE is then your Polish text displayed correctly in program.
This is your problem: You write to IDE +" ?? owego " and ?? is your polish unicode character, wrongly displayed in IDE but correctly in program as second character.
You can not using this way for harddrive paths. Greetings from Czech republic :)
IF unicode&
= 0 THEN unicode&
= 9744 PRINT " ----------------------------------------------------" PRINT " Program do obliczania element" + CHR$(162) + "w odcinka ko" + CHR$(136) + "owego" PRINT " ----------------------------------------------------" Microsoft_pc_cp852:
DATA 199,252,233,226,228,367,263,231,322,235,336,337,238,377,196,262 DATA 201,313,314,244,246,317,318,346,347,214,220,356,357,321,215,269 DATA 225,237,243,250,260,261,381,382,280,281,172,378,268,351,171,187 DATA 9617,9618,9619,9474,9508,193,194,282,350,9571,9553,9559,9565,379,380,9488 DATA 9492,9524,9516,9500,9472,9532,258,259,9562,9556,9577,9574,9568,9552,9580,164 DATA 273,272,270,203,271,327,205,206,283,9496,9484,9608,9604,354,366,9600 DATA 211,223,212,323,324,328,352,353,340,218,341,368,253,221,355,180 DATA 173,733,731,711,728,167,247,184,176,168,729,369,344,345,9632,160 PrintIt a$
-
Děkuji. Nyní se zobrazuje dobře. Co jste ale v kódu změnili, nemohu zjistit.
> Thank you. It is now showing well. But I can't find out what you've changed in the code.
-
Please use [code=qb64][/code] around your code. And let's keep it in English, please.
-
Thank you. What you've changed that now displays properly. I can't see myself.
-
The change is only on the line 20 in my source code, in your text
Program do obliczania element" + CHR$(162) + "w odcinka ko" + CHR$(136) + "owego"
while your original text was
Program do obliczania element" + CHR$(162) + "w odcinka ko" + CHR$(136) + "owego"
see you character ^ before word "owego"? This was problem.
-
Thank you. What you've changed that now displays properly. I can't see myself.
Difference is only a ? removed:
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
Ryster, if you use Windows CP 1250 encoding (we have both the same, I just had to add a Polish keyboard to the system for the following example) then you can type it into the IDE in Polish directly. Here's proof that it works.
for Odin:
Because the following source code contains unicode characters, CODE must be used without formatting.
_TITLE "Calendarium"
SCREEN _NEWIMAGE(130, 45, 0)
_SCREENMOVE _MIDDLE
X = _DESKTOPWIDTH
IF X < 1400 THEN Fontsize = 16 ELSE Fontsize = 18
_FONT _LOADFONT("C:\Windows\Fonts\lucon.ttf", Fontsize, "MONOSPACE")
_DELAY .2
_SCREENMOVE _MIDDLE
RESTORE Microsoft_windows_cp1250 'central europe languages PL, CZ, SK, HU...
FOR ascii = 128 TO 255
READ unicode&
IF unicode& = 0 THEN unicode& = 9744
_MAPUNICODE unicode& TO ascii
NEXT
COLOR 10, 1
CLS
PRINT " "
PRINT " "
PRINT " ----------------------------------------------------"
PRINT " Program do obliczania elementów odcinka kołowego "
PRINT " ----------------------------------------------------"
PRINT "pokus o zobrazení česky psaného textu s použitím polského kodování. "
Microsoft_windows_cp1250:
DATA 8364,0,8218,0,8222,8230,8224,8225,0,8240,352,8249,346,356,381,377
DATA 0,8216,8217,8220,8221,8226,8211,8212,0,8482,353,8250,347,357,382,378
DATA 160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379
DATA 176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380
DATA 340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270
DATA 272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223
DATA 341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271
DATA 273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729
END
SUB PrintIt (a$)
PrintIt a$
END SUB
Output contains czech and polish characters, all displayed correctly.
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
for others, I'm just adding a sample of what it actually looks like in the IDE
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
for others, I'm just adding a sample of what it actually looks like in the IDE
[ This attachment cannot be displayed inline in 'Print Page' view ]
Can’t you set the IDE to code page 1250 as well, in the options?
-
@SMcNeill Hi. Yeah, right, I can. But the default setting looks best, then it's the clearest. That image is by default. This is by no means an attempt to defame the IDE.
You know, when I set it to my encoding, it looks like this:
(note the decay of characters along the edges of the IDE and in the menu) - but this is quite clear, it is due to ASCII transcoding.
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
I can't believe it how could I have missed it. I need to change my glasses. Thank you for explaining the visual problem.
Thank You: Piotr (neighbor), bplus, SMcNeill.
Regards