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


Groups > comp.lang.python > #49330

Re: Devnagari Unicode Conversion Issues

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 <python@mrabarnett.plus.com>
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 <python@mrabarnett.plus.com>
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 <c8ea987a-a493-4adc-a35d-11a82f1bd03a@googlegroups.com>
In-Reply-To <c8ea987a-a493-4adc-a35d-11a82f1bd03a@googlegroups.com>
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 <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.3932.1372346917.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


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")
नेपाली

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


Thread

Devnagari Unicode Conversion Issues darpan6aya <akshay.ksth@gmail.com> - 2013-06-27 08:05 -0700
  Re: Devnagari Unicode Conversion Issues MRAB <python@mrabarnett.plus.com> - 2013-06-27 16:28 +0100
  Re: Devnagari Unicode Conversion Issues darpan6aya <akshay.ksth@gmail.com> - 2013-06-27 08:39 -0700
    Re: Devnagari Unicode Conversion Issues Dave Angel <davea@davea.name> - 2013-06-27 12:28 -0400

csiph-web