It's not. If after applying my solution you still see question marks instead of the desired output then try to ask somebody (from Russia, preferably) if he/she has the same problem, because that may mean that your font settings are wrongly configured. I have a script that works this way and it works just fine for Russians, but outputs some weird chars for me (something similar to your 2nd code block).