Ok, I got it. But I wonder: if my code changes codepage of a "string" to
e.g. 1250, will all Lazarus string functions work ok with such changed
string? For ex, will Pos('Петя', s) work?
Depends on what you do with the returned value. Lazarus uses UTF-8 by default, thus the constant would be in UTF-8 as well and Pos() takes two AnsiString parameters, thus CP_ACP. So the constant is passed along as is and s is converted to UTF-8. Depending on the encoding of the characters you might get a different position, thus you should ensure that both of your strings have the same type (not tested) or you should work simply in UTF-8 and only convert for input/output purposes.