Keyword is "in most cases". But not in every one. Unfortunately.
Not sure about Pos, but Str:=Copy('Трапециедальная',1,23); causes funny results ...
Yes, then you must use UTF8Copy but fortunately you don't need to copy a fixed number of characters very often.
If you deal with valid UTF-8 strings, you can safely use Pos, Copy and Length. They work with byte positions but due to inherent properties of UTF-8 they work correctly ALWAYS.
Say you want to cut your text to a user specified UTF-8 character. The user has typed the char in Edit1. Here you go :
Txt := 'Трапециедальная';
i := Pos(Edit1.Text, Txt);
if i > 0 then
Txt := Copy(Txt, 1, i-1);
See other examples from the wiki page I linked and from internet.
I think using my unit (B) is also good because it can be turned off by setting some {$IfNdef FPC3} (or something that tells that FPC3 compiler/RTL uses UTF8) around it, for future compatibility with FPC3.
No, you clearly have not understood the issue.
The "future compatibility with FPC3" does not change anything when dealing with individual UTF-8 characters. You need to use either Pos/Copy/Length or UTF8Pos/UTF8Copy/UTF8Length depending on your particular code. This one detail stays the same when we move to the "better" UTF-8 support.
Pos/Copy/Length work with byte positions.
UTF8Pos/UTF8Copy/UTF8Length work with UTF-8 character positions.
Most often you can continue using the byte positions but sometimes you need UTF-8 character positions.
You should not blindly convert everything to use UTF-8 character positions. It slows down your code in any case and leads to wrong results in some cases.
You must go through your code case by case.
Unicode is unbelievable complex. Now we only touched the surface. It happened to me at least 10 time that I though I understood it, but then something new came up again.