Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'charset:iso-8859-7': 0.04; 'encoding': 0.05; 'skip:\\ 20': 0.07; 'ascii': 0.09; 'bytes.': 0.09; 'filename': 0.09; 'filenames': 0.09; 'happens.': 0.09; 'skip:\\ 10': 0.09; 'python': 0.11; 'charset': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'wrote:': 0.18; 'things.': 0.19; 'command': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'byte': 0.24; 'unicode': 0.24; 'question': 0.24; 'source': 0.25; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; "we'd": 0.29; 'character': 0.29; "doesn't": 0.30; 'returned': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'file': 0.32; 'text': 0.33; 'guess': 0.33; 'actual': 0.34; 'subject:from': 0.34; 'could': 0.34; 'problem': 0.35; 'subject: (': 0.35; "can't": 0.35; 'but': 0.35; 'there': 0.35; 'sequence': 0.36; '\xf4\xef\xf5': 0.36; 'possible': 0.36; 'should': 0.36; 'example,': 0.37; 'starting': 0.37; 'message-id:@gmail.com': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'even': 0.60; 'read': 0.60; 'tell': 0.60; 'hope': 0.61; "you're": 0.61; 'first': 0.61; 'anything.': 0.68; 'greek': 0.84; 'was:': 0.91 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Tue, 04 Jun 2013 23:40:39 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.4) Gecko/20120421 Thunderbird/10.0.4 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain) References: <2c425f2b-99de-4453-964e-c585f2043f71@googlegroups.com> <306a22ea-fbf7-4097-af31-121a999957d6@googlegroups.com> <9c482ba0-23ac-4e66-a0e1-a18be9fd82d8@googlegroup> <06a19483-65df-4fcd-9430-b45a01c9dbab@googlegroups.com> <0c215f6d-c1eb-4dbf-b132-80e83ece0992@googlegroups.com> <4c271468-22f4-4c93-af14-02b978b2e6bd@googlegroups.com> <0a05fe41-12a9-47e5-a4e9-170140eb3eea@googlegroups.com> <96d574cf-653a-4d49-a5c9-475dfe082ccb@googlegroups.com> <4fa2ed0b-f6e8-4cfd-bb81-92c30deba91e@googlegroups.com> In-Reply-To: <4fa2ed0b-f6e8-4cfd-bb81-92c30deba91e@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370410849 news.xs4all.nl 15900 [2001:888:2000:d::a6]:52719 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47020 On 06/04/2013 10:15 PM, Νικόλαος Κούρας wrote: > One of my Greek filenames is "Ευχή του Ιησού.mp3". Just a Greek > filename with spaces. Is there a problem when a filename contain both > english and greek letters? Isn't it still a unicode string? > > All i did in my CentOS was 'mv "Euxi tou Ihsou.mp3" "Ευχή του > Ιησού.mp3" > > and the displayed filename after 'ls -l' returned was: > > is -rw-r--r-- 1 nikos nikos 3511233 Jun 4 14:11 \305\365\367\336\ > \364\357\365\ \311\347\363\357\375.mp3 > > There is no way at all to check the charset used to store it in hdd? > It should be UTF-8, but it doesn't look like it. Is there some linxu > command or some python command that will print out the actual > encoding of '\305\365\367\336\ \364\357\365\ > \311\347\363\357\375.mp3' ? I can see that you are starting to understand things. I can't answer your question (don't know the answer), but you're correct about one thing. A filename is just a sequence of bytes. We'd hope it would be utf-8, but it could be anything. Even worse, it's not possible to tell from a byte stream what encoding it is unless we just try one and see what happens. Text editors, for example, have to either make a guess (utf-8 is a good one these days), or ask, or try to read from the first line of the file using ascii and see if there's a source code character set command to give it an idea.