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


Groups > comp.lang.python > #44942

Re: Making safe file names

Date 2013-05-07 23:49 -0500
From Andrew Berg <bahamutzero8825@gmail.com>
Subject Re: Making safe file names
References <51895D03.4000300@gmail.com> <518998FE.6030805@davea.name> <mailman.1430.1367974288.3114.python-list@python.org> <5189c941$0$11094$c3e8da3@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.1442.1367992489.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 2013.05.07 22:40, Steven D'Aprano wrote:
> There aren't any characters outside of UTF-8 :-) UTF-8 covers the entire 
> Unicode range, unlike other encodings like Latin-1 or ASCII.
You are correct. I'm not sure what I was thinking.

>> I don't understand. I have no intention of changing Unicode characters.
> 
> Of course you do. You even talk below about Unicode characters like * 
> and ? not being allowed on NTFS systems.
I worded that incorrectly. What I meant, of course, is that I intend to preserve as many characters as possible and have no need to stay
within ASCII.

> If you have an artist with control characters in their name, like newline 
> or carriage return or NUL, I think it is fair to just drop the control 
> characters and then give the artist a thorough thrashing with a halibut.
While the thrashing with a halibut may be warranted (though I personally would use a rubber chicken), conflicts are problematic.

> Does your mapping really need to be guaranteed reversible? If you have an 
> artist called "JoeBlow", and another artist called "Joe\0Blow", and a 
> third called "Joe\nBlow", does it *really* matter if your application 
> conflates them?
Yes and yes. Some artists like to be real cute with their names and make witch house artist names look tame in comparison, and some may
choose to use names similar to some very popular artists. I've also seen people scrobble fake artists with names that look like real artist
names (using things like a non-breaking space instead of a regular space) with different artist pictures in order to confuse and troll
people. If I could remember the user profiles with this, I'd link them. Last.fm is a silly place.
As I said before though, I don't think control characters are even allowed in artist names (likely for technical reasons).
-- 
CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1

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


Thread

Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 19:51 -0500
  Re: Making safe file names Neil Hodgson <nhodgson@iinet.net.au> - 2013-05-08 11:28 +1000
    Re: Making safe file names Dave Angel <davea@davea.name> - 2013-05-07 21:45 -0400
      Re: Making safe file names Roy Smith <roy@panix.com> - 2013-05-07 22:21 -0400
    Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 21:20 -0500
    Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 21:06 -0500
    Re: Making safe file names Dave Angel <davea@davea.name> - 2013-05-08 00:10 -0400
    Re: Making safe file names albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-05-28 13:44 +0000
      Re: Making safe file names Chris Angelico <rosuav@gmail.com> - 2013-05-28 23:53 +1000
      Re: Making safe file names Grant Edwards <invalid@invalid.invalid> - 2013-05-28 16:03 +0000
  Re: Making safe file names Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-08 03:40 +0000
    Re: Making safe file names Dave Angel <davea@davea.name> - 2013-05-08 00:13 -0400
      Re: Making safe file names Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-08 04:47 +0000
    Re: Making safe file names Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-07 23:49 -0500

csiph-web