Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'charset:iso-8859-7': 0.04; 'encoding': 0.05; 'encoded': 0.07; 'rename': 0.07; 'skip:\\ 20': 0.07; 'utf-8': 0.07; 'filename': 0.09; 'filenames': 0.09; 'locale': 0.09; 'skip:\\ 10': 0.09; 'stored': 0.12; 'command- line': 0.16; 'expects': 0.16; "he'd": 0.16; 'all.': 0.16; 'passing': 0.19; 'command': 0.22; '>>>': 0.22; 'shell': 0.22; 'header:User-Agent:1': 0.23; 'byte': 0.24; 'bytes': 0.24; 'looks': 0.24; '---': 0.24; 'posts': 0.26; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'file': 0.32; 'subject:from': 0.34; 'problem': 0.35; 'subject: (': 0.35; 'but': 0.35; "he's": 0.36; 'so,': 0.37; 'operating': 0.37; 'received:10': 0.37; '(i.e.,': 0.38; 'same.': 0.38; 'window': 0.38; 'to:addr:python-list': 0.38; 'previous': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'most': 0.60; 'new': 0.61; 'name': 0.63; 'biggest': 0.67; 'guessed': 0.84; 'streams': 0.84; 'treats': 0.84; 'have.': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=modelnine.org; s=modelnine1012; t=1370508659; bh=qSUuipCzBDujyfXhy0dRBRSW04AYlrER2AyFN2QlgbI=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=i1Fz3ic9O3gIWextfOoPCys0jUqarzeJZDHIV3w7kwfbtOcG6WABJH2Pb1TFn6sFo 6Q+bG4T8RPk3/9st/gG8w9qt3m3RHbs5fksGN+zlc8vytUhTYutkOcs0n27iW2asak aLUmP1Wnlvz0QklpES96XUSwq1oyxXU4/vi/r4eQ= Date: Thu, 06 Jun 2013 10:50:55 +0200 From: Heiko Wundram User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Thunderbird/22.0 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> <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> <51AECF57.8020801@gmail.com> <51AF6ADE.5080506@mrabarnett.plus.com> In-Reply-To: <51AF6ADE.5080506@mrabarnett.plus.com> Content-Type: text/plain; charset=ISO-8859-7; format=flowed 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370508661 news.xs4all.nl 15874 [2001:888:2000:d::a6]:45656 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47198 Am 05.06.2013 18:44, schrieb MRAB: > From the previous posts I guessed that the filename might be encoded > using ISO-8859-7: > > >>> s = b"\305\365\367\336\ \364\357\365\ \311\347\363\357\375.mp3" > >>> s.decode("iso-8859-7") > 'Ευχή\\ του\\ Ιησού.mp3' > > Yes, that looks the same. Most probably, his terminal is set to ISO-8859-7, so that when he issues the rename command on the command-line of his shell session, the "mv" command gets a stream of bytes as the new file name which happens to be the ISO-8859-7 encoding of the file name he'd like the file to have. This is what's stored on disk. So, his biggest problem isn't that the operating system is encoding agnostic wrt. filenames (i.e., treats them as a stream of bytes), but rather that he's using an ISO-7 terminal window when having set up UTF-8 as his operating system locale and expects filenames to be encoded in UTF-8 when he's not passing in UTF-8 byte streams from his client computer at all. -- --- Heiko.