QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: kservice on September 22, 2021, 02:04:14 pm
-
Hello everyone!
Installed QB64 on Win8.1 64bit. The problem lies in the fact that when using the Russian language on the screen I get inadequate characters similarly occurs when opening previously written programs with comments in Russian.
Attempt to use Options / Language does not give a positive result. And that strange, when using any of the encodings, the characters on the screen remains the same. Advise me what you can do?
-
Give us back Steven Seagal, and we'll talk!
My guess would be...
1) Open the Q64 IDE
2) Click the "Options" tab.
3) In the menu that opens, lick the "Language" tab.
4) In the menu that opens,scroll down and highlight: MICSOFT_WINDOWS_CP1251
5) Click OK.
According to the QB64 Wiki: http://www.qb64.org/wiki/Code_Pages
CP1251 is stated as the unicode used for Russian.
I hope that helps, but I'm sure if it doesn't, someone else will be along shortly with a better answer. I've never used the language option, so I can't be sure my approach is the correct one.
Welcome to the forum,
Pete
-
Attempt to use Options / Language does not give a positive result. And that strange, when using any of the encodings, the characters.
Including Win 1251
-
Changing the encoding options in Options->Language will only produce any results if you also set a unicode monospace font in Options->Display. With the native emulated VGA font you won't see any difference.
-
Thank you, it turned out. At first, the encoding was CP1251 and this "miracle" was obtained.
[ This attachment cannot be displayed inline in 'Print Page' view ] Changed the encoding on the CP866 and the real miracle happened. Thanks again. The program likes, and with the fonts there was a problem.
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
Joy is overshadowed. It turns out that in CP866, the Russian encoding works incorrectly. Therefore, new comments in Russian in the program can not be done. But those comments that were made in Russian still in QB45 are displayed correctly. (This can be seen in the previous screen).
That's how Russian letters look like йцукенгшщзхъфывапролджэячсмитьбю
[ This attachment cannot be displayed inline in 'Print Page' view ]
Maybe something else will you advise?
-
Can I somehow (for example, changing the IDE_Global.bas file) add Koi8-R encoding?
Maybe it will bring the desired result.
-
My advice would be to code in an IDE that supports Russian and then just compile with QB64 from the command line.
-
Well, and what, for example, IDE for QB64 with the support of Russian you advise?
-
try Notepad++ https://notepad-plus-plus.org/
see NppThemesQB.7z https://www.qb64.org/forum/index.php?topic=809
-
Ah, Notepad++. That was what I coded in for a few years, until the IDE got up to speed. Of course in English. If it has good language support, it would be my choice two, especially if I isn't a master at english. Yes Steve, I know.
Pete
-
I use NotePad ++, but is it IDE? I prefer to use programs that allow and write a program, and immediately check the performance. At least, so I did in QB45. Thank you, take your opinion.
For other QB64 programming questions, it is better to create a new topic?
-
I did not find such an encoding with a Cyrillic, which would be correctly displayed in QB64 after copying from NotePad ++
-
It feels like CP866 and CP1251 encoding in the program are confused by places. In order for the text scored in NotePad ++ in Russian in the CP866 encoding, the IDE is correctly displayed in QB64 IDE in the CP866 encoding, it is necessary to pre-translate into the CP1251 encoding and only after that copy to QB64 IDE.
-
I use NotePad ++, but is it IDE? I prefer to use programs that allow and write a program, and immediately check the performance. At least, so I did in QB45. Thank you, take your opinion.
For other QB64 programming questions, it is better to create a new topic?
Notepad++ is NOT and IDE. It is a text app. As you discovered, you can copy and paste your code from Notepad++ into the QB64 IDE.
For other QB64 programming questions, yes, best to start a new topic in a new thread (post).
Pete
-
@kservice you can use the geany IDE https://www.geany.org/ but you must be aware that geany is a multi-programming-language IDE that determines what compiler to launch depending on the file extension, for a *.bas file it will try to launch FreeBASIC also the highlighting is that of FB
you can write a small batch file that will launch qb64 and compile your program, substitute the fbc command with the name of your bat file
you must have a .bas file open in geany to adjust the menu settings for basic files because the menu settings vary depending on what kind of document is open, once you have a bas file open click on the Build->Set Build Commands in the Compile box you will see something like
fbc -w all "%f"
you could replace fbc with a batch file that will launch qb64 and compile your program, but for simplicity try
full-path-to-qb64 -x "%f"
last time I tried it, it would not highlight the lines containing errors, don't remember if it even would report the error line, that's why it would be good for you to write a batch file that will catch an error if there is one, if your program compiles successfully then you can click on the run button
also for non-ASCII language you probably need to make sure to BOM your document, click on Document->Write Unicode BOM
-
good news, it does report the error line number but it does not highlight the line
-
For other QB64 programming questions, yes, best to start a new topic in a new thread (post).
I would gladly closed the topic and moved to solving other issues. But still early. It turns out that to achieve the correct reproduction of Cyrillic in QB64 IDE is still half. After compiling and running a program to execute on the screen, instead of Cyrillic garbage. How do I understand it is irresistible?
[ This attachment cannot be displayed inline in 'Print Page' view ]
May be I Can apply any other compiler?
-
I just tried this with QB64
Print "Статья 1 Все люди рождаются свободными и равными в своем достоинстве и правах." Print "Они наделены разумом и совестью и должны поступать в отношении друг друга в духе" Print "Статья 2 Каждый человек должен обладать всеми правами и всеми свободами, провоз-" Print "глашенными настоящей Декларацией, без какого бы то ни было различия, как-то в от-" Print "ношении расы, цвета кожи, пола, языка, религии, политических или иных убеждений," Print "национального или социального происхождения, имущественного, сословного или" Print "иного положения. Кроме того, не должно проводиться никакого различия на основе по-" Print "литического, правового или международного статуса страны или территории, к кото-" Print "рой человек принадлежит, независимо от того, является ли эта территория независи-" Print "мой, подопечной, несамоуправляющейся или как-либо иначе ограниченной в своем су-"
and the output is garbage, then I tried this
Print "Статья 1 Все люди рождаются свободными и равными в своем достоинстве и правах." Print "Они наделены разумом и совестью и должны поступать в отношении друг друга в духе" Print "Статья 2 Каждый человек должен обладать всеми правами и всеми свободами, провоз-" Print "глашенными настоящей Декларацией, без какого бы то ни было различия, как-то в от-" Print "ношении расы, цвета кожи, пола, языка, религии, политических или иных убеждений," Print "национального или социального происхождения, имущественного, сословного или" Print "иного положения. Кроме того, не должно проводиться никакого различия на основе по-" Print "литического, правового или международного статуса страны или территории, к кото-" Print "рой человек принадлежит, независимо от того, является ли эта территория независи-" Print "мой, подопечной, несамоуправляющейся или как-либо иначе ограниченной в своем су-"
the output is garbage
one problem is that QB64 won't compile a file with a Unicode BOM
the first snippet saved with a BOM and compiled with FreeBASIC prints perfectly on the console [ This attachment cannot be displayed inline in 'Print Page' view ] [/code]
-
text changed after edit
with an extra
the Cyrillic text shows on the forum
-
You've configured the IDE setting a font that supports the character set you wish to use and by setting the proper code page. You need to do the same if you want to output text in Russian in your program. The example below comes from the wiki page for _MapUnicode. Take it and adapt it as required.
FOR ASCIIcode
= 128 TO 255
cnt = cnt + 1
Microsoft_pc_cpMIK:
DATA 1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055 DATA 1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071 DATA 1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087 DATA 1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103 DATA 9492,9524,9516,9500,9472,9532,9571,9553,9562,9566,9577,9574,9568,9552,9580,9488 DATA 9617,9618,9619,9474,9508,8470,167,9559,9565,9496,9484,9608,9604,9612,9616,9600 DATA 945,223,915,960,931,963,181,964,934,920,937,948,8734,966,949,8745 DATA 8801,177,8805,8804,8992,8993,247,8776,176,8729,183,8730,8319,178,9632,160
http://www.qb64.org/wiki/MAPUNICODE
http://www.qb64.org/wiki/Code_Pages
http://www.qb64.org/wiki/LOADFONT
http://www.qb64.org/wiki/FONT
-
I have already read all this, but I did not understand how to apply it in my situation. Tell me, please, how to adapt?
1. What data should I substitute in DATA?
2. Why values of symbol codes in the example do not coincide with the values that I see, for example, on en.wikipedia.org?
3. What kind of number system shows codes in the DATA field (OCT, HEX, DEC .....?