Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!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 X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'string': 0.09; '8bit%:68': 0.09; 'python': 0.11; '2.7?': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject:Unicode': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'unicode': 0.24; 'header:In- Reply-To:1': 0.27; 'text': 0.33; 'convert': 0.35; 'received:84': 0.35; 'skip:" 50': 0.36; 'words,': 0.36; 'so,': 0.37; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; '8bit%:100': 0.72; 'reply-to:addr:python.org': 0.84; 'skip:\xe0 10': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=RZapVTdv c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=K2DDQYBT4xIA:10 a=yEjatmTQod8A:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=CVej5D0UhLMA:10 a=bKqajUsTy8893Isblc0A:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett:2500 Date: Thu, 27 Jun 2013 16:28:43 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Devnagari Unicode Conversion Issues References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372346917 news.xs4all.nl 15864 [2001:888:2000:d::a6]:59033 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49330 On 27/06/2013 16:05, darpan6aya wrote: > How can i convert text of the following type > > नेपाली > > into devnagari unicode in Python 2.7? > Is that a bytestring? In other words, is its type 'str'? If so, you need to decode it. That particular string is UTF-8: >>> print "नेपाली".decode("utf-8") नेपाली