I found a solution to my problem and wrote a small library to solve this problem.
It allows you to output any message in any language that is supported by UTF-8 encoding.
However, when using it, LSPDFR crashes with an error: System.IO.FileNotFoundException: "System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"
I wrote the library on .NET Framework 4.7.2.
In this case, the message is displayed.
Full error log:
What could be the reason for this behavior?