looking for expertise

klappnase klappnase at web.de
Thu Mar 3 11:18:30 CET 2005


"Neil Hodgson" <nhodgson at bigpond.net.au> wrote in message news:<PqsVd.181659$K7.763 at news-server.bigpond.net.au>...
> Michael:
> 
> > Like I said, it's only supposed to run on linux; anyway, is it likely
> > that problems will arise when filenames I have to handle have
> > basically three sources:
> > ...
> > 3. filenames created by user input
> 
>    Have you worked out how you want to handle user input that is not
> representable in the encoding? It is easy for users to input any characters
> into a Unicode enabled UI either through invoking an input method or by
> copying and pasting from another application or character chooser applet.
> 
>    Neil

As I must admit, no. I just couldn't figure out that someone will really do this.

I guess I could add a test like (pseudo code):

try:
    test = fsdecode(input)# convert to unicode
    test.encode(sysencoding)
except:
    # show a message box with something like "Invalid file name"

Please tell me if you find any other possible gotchas.

Thanks so far

Michael



More information about the Python-list mailing list