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


Groups > comp.lang.python > #41408

Re: Read utf-8 file

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'skip:p 60': 0.05; 'subject:file': 0.07; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:80.91.229.3': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-dialin.net': 0.16; 'wrote:': 0.17; 'skip:u 30': 0.17; '>>>': 0.18; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.28; '8bit%:5': 0.29; 'print': 0.32; 'to:addr :python-list': 0.33; 'received:org': 0.36; 'display': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: Read utf-8 file
Date Mon, 18 Mar 2013 11:37:05 +0100
Organization None
References <1f54b5e0-efac-4636-921d-aa087d05df44@a14g2000vbm.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Gmane-NNTP-Posting-Host p5084a355.dip.t-dialin.net
User-Agent KNode/4.7.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3421.1363603041.2939.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1363603041 news.xs4all.nl 6952 [2001:888:2000:d::a6]:54059
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41408

Show key headers only | View raw


moonhkt wrote:

> How to display
> e4b8ad for 中 in python ?

Python 2

>>> print u"中".encode("utf-8").encode("hex")
e4b8ad


Python 3

>>> print(binascii.b2a_hex("中".encode("utf-8")).decode("ascii"))
e4b8ad

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


Thread

Read utf-8 file moonhkt <moonhkt@gmail.com> - 2013-03-18 02:34 -0700
  Re: Read utf-8 file Peter Otten <__peter__@web.de> - 2013-03-18 11:37 +0100

csiph-web