i have noticed that your script doesnt accept many characters, which are accepted by normal WLM though.
and i would guess they are the ones used in Unicode (not included in ANSI) e.g Я, i н и ш я н etc..
edit1: it seems the forum cant display them either
edit2: my suggestion would be if the .txt file thats created by the script to be saved in Unicode and not ANSI, maybe that will fix it.