Xusinboy Bekchanov wrote:Your IDE is RichMasm editor?
Yes, but with a plugin and 4 different batch files. It works fine for FB, except when fbc.exe plays foul, as above; but this is a rare case. For example, this compiles and runs fine with RichMasm (my OS is Italian, so Russian needs Utf-8 or Utf-16 to be displayed):
Code: Select all
#include "Windows.bi"
Print String(20, str("x")) ' String(20, "x") used to choke if there was a Utf-8 BOM, but here it works...
Print Left("Добро пожаловать", 5); ' combined output of the three rows:
Print Mid("Добро пожаловать", 6, 5); ' Добро пожалоловать
Print Right("Добро пожаловать", 6)
Print "That was a Russian text printed as Utf8"
MessageBoxW(0, "Добро пожаловать", "Hello title", MB_OK)
If you want to use this in WinFBE, you must first save it as Utf8. You cannot paste it into a non-Utf8 WinFBE windows, probably a "feature" of the Scintilla control.
If, however, you save the file as Utf-16 and open it in WinFBE, for example with ...
Code: Select all
' checker3 from Programming Windows 3.0 (c) 1990 Charles Petzold
' Demonstrates child windows, childWndProc(), mouse use, line drawing
'
' #define Unicode ' Macq: Simple tutorial to create first Windows applications
#include once "windows.bi"
#define DIVISIONS 8
MessageBoxW(0, "Добро пожаловать", "Hello title", MB_OK)
...
... then you will see the MessageBoxW correctly, but the strings get still passed partly as Utf-16, partly as Ansi/Utf8.
Lesson learned today:
if fbc.exe sees the Utf-8 BOM, it decides that strings passed to Windows APIs (not all of them, but some) must be Utf-16