Does that mean that this is by design?
It's bad design for East Asia. We'll be in the string constant variable hell(Or type casting hell).
Not really by design. It is a shortcoming of our new "UTF-8 hack" and FPC which is not designed for it exactly.
Another choice is to use FPC 3.0 without this new UTF-8 system. It leads to a swamp of hard-to-predict problems. As an example see this issue and its related issues :
http://bugs.freepascal.org/view.php?id=28406A third choice is to continue using FPC 2.6.4 and Lazarus with its UTF-8 specific functions. We will make sure Lazarus can be compiled and used with FPC 2.6.4 for a long time to come.
How many constructs like "'テスト' + IntToStr(2)" do you have? There cannot be so many. To me it looks like an easy job to assign the constant to a variable first.
Besides, Application.MessageBox with its PChar is a poor example because LCL provides an equivalent with String parameter for this and for many other functions.
is "Set UTF8 in RTL" fpc 3.0 friendly?
I mean FPC 3.0 should be code-page aware, thus no extra workaround is needed?
Yes, this whole thing is made with FPC 3.0 in mind. Later FPC versions may already have a proper UnicodeString RTL and other libs and things can be done differently. That however will take many years to come, our UTF-8 system works already now.