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


Groups > comp.lang.python > #58504

Re: how to find out utf or not

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!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.008
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:not': 0.03; 'suppose': 0.07; 'utf-8': 0.07; '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:plane.gmane.org': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'not,': 0.20; 'header:User-Agent:1': 0.23; 'unicode': 0.24; 'compare': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'initialized': 0.31; 'e.g.': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'such': 0.63; 'determine': 0.67; 'subject:find': 0.84; 'received:108': 0.93; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: how to find out utf or not
Date Tue, 05 Nov 2013 08:41:07 -0600
References <1383656577.1350.6.camel@debian> <1383656577.1350.6.camel@debian>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host pool-108-12-82-77.hstntx.dsl-w.verizon.net
In-Reply-To <1383656577.1350.6.camel@debian>
User-Agent Groundhog Newsreader for Android
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2055.1383662485.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1383662486 news.xs4all.nl 15995 [2001:888:2000:d::a6]:38501
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:58504

Show key headers only | View raw


On Tue, 05 Nov 2013 16:32:57 +0330, Mohsen Pahlevanzadeh 
<mohsen@pahlevanzadeh.org> wrote:
> Suppose i have a variable such as : myVar = 'x'

> May be it initialized with myVar = u'x' or myVar = 'x'

> So i need determine content of myVar that it's utf-8 or not, how 
can i
> do it?

Use the type() function and compare to unicode or str respectively.
E.g.  If type(myvar)==unicode:

-- 
DaveA

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


Thread

Re: how to find out utf or not Dave Angel <davea@davea.name> - 2013-11-05 08:41 -0600
  Re: how to find out utf or not Neil Cerutti <neilc@norwich.edu> - 2013-11-05 15:30 +0000
    Re: how to find out utf or not Dave Angel <davea@davea.name> - 2013-11-06 00:03 -0600

csiph-web