As for the undefined
part, the reason is that you have no content in what you are trying to edit.
If you follow the section as described in the FAQ:
Define a function myFunction
function myFunction() {}
Then edit with your editor:
edit myFunction
Everything will work as expected. So the problem was your q
thingy was not defined, hence the output.
The other characters are likely a system code page issue. I'm not sure if interaction with the shell expects ANSI or whether UTF-8 is okay. But anything else or UTF-16 might cause the issue. Hard to tell without knowing what language setting you have, etc.