Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44916

Re: Making safe file names

Date 2013-05-07 18:00 -0500
From Andrew Berg <bahamutzero8825@gmail.com>
Subject Re: Making safe file names
References <51895D03.4000300@gmail.com> <kmbtjn$cvc$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.1427.1367969029.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 2013.05.07 17:01, Terry Jan Reedy wrote:
> Sounds like you want something like the html escape or urlencode 
> functions, which serve the same purpose of encoding special chars. 
> Rather than invent a new tranformation, you could use the same scheme 
> used for html entities. (Sorry, I forget the details.) It is possible 
> that one of the functions would work for you as is, or with little 
> modification.
This has the problem of mangling non-ASCII characters (and artist names with non-ASCII characters are not rare). I most definitely want to
keep as many characters untouched as possible so that the files are easy to identify by looking at the file name. Ideally, only characters
that file systems don't like would be transformed.

-- 
CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 18:00 -0500

csiph-web