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


Groups > comp.lang.python > #44916 > unrolled thread

Re: Making safe file names

Started byAndrew Berg <bahamutzero8825@gmail.com>
First post2013-05-07 18:00 -0500
Last post2013-05-07 18:00 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#44916 — Re: Making safe file names

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-05-07 18:00 -0500
SubjectRe: Making safe file names
Message-ID<mailman.1427.1367969029.3114.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web