I don't know what you use in your code to read from the console, but make sure you have not set it to eastern european charset. Windows will use the local Windows codepage on the console, which can vary following the language used! I don't know eastern european characters enough to tell you if UTF8 charset is interpreted as cp125x or if UTF8 is expected and you use cp125x as charset in your case. That would be a good starting point. Create a text file in Windows eastern european encoding (cp125x) and open it with a Linux text editor which lets you change the encodings, KWrite for example. Then see how you can reproduce the garbled characters. Welcome in the codepage hell
EDIT: I see you are using putty. Might this be the problem? I don't know what you are doing with putty exactly.