Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=python.org; s=200901; t=1356013178; bh=2fb6iHF1+uPLEzmVRB+/HyVxSWsj2Zi98cwr0Pphr6o=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=UxonYGu9x0Z9urZUzoN0jy8VrpNGEsBApWqjWrLZDhMBJovMX0tm8ie5Wn6IPuvpV 9NqsKYhmFrx6RysMpHPY4T3mbjLjjlVWok2cdZb8Kf6boKXKDMz1ITrCMIBsZ6Tdzj 9Bfrz3ya/pLsDcH5fMsAesaECkHCCsyEwhfr2og4= Date: Thu, 20 Dec 2012 15:19:37 +0100 From: Christian Heimes User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: iMath Subject: Re: how to detect the encoding used for a specific text data ? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: python-list@python.org 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356013179 news.xs4all.nl 6974 [2001:888:2000:d::a6]:40607 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35198 Am 20.12.2012 12:57, schrieb iMath: > how to detect the encoding used for a specific text data ? You can't. It's not possible unless the file format can specify the encoding somehow, e.g. like XML's header . Sometimes you can try and make an educated guess. But it's just a guess and it may give you wrong results. Christian