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


Groups > comp.lang.python > #6741

RE: sqlalchemy and Unicode strings: errormessage

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ramit.prasad@jpmchase.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'completeness': 0.05; 'used.': 0.07; 'utf-8': 0.09; '>>>': 0.12; '712': 0.16; 'affiliates,': 0.16; 'currencies': 0.16; 'encode': 0.16; 'opened,': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:169.70': 0.16; 'received:172.18.0': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'solicitation': 0.16; 'standard)': 0.16; 'subject:Unicode': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'convert': 0.19; 'to:2**1': 0.20; 'header:In-Reply-To:1': 0.21; 'applicable,': 0.23; 'converts': 0.23; 'herein': 0.23; 'works.': 0.23; 'received:169': 0.25; 'received:169.254': 0.25; 'string': 0.26; '(the': 0.28; 'reflect': 0.28; 'unicode': 0.29; '>and': 0.30; 'chase': 0.30; 'received:155': 0.30; 'received:159': 0.30; 'unicode,': 0.30; 'looks': 0.31; '(including': 0.32; 'does': 0.33; 'to:addr:python- list': 0.33; 'actually': 0.33; 'characters': 0.34; 'thank': 0.35; 'received:172.18': 0.35; 'phone:': 0.36; 'format.': 0.36; 'accepted': 0.36; 'charset:us-ascii': 0.36; 'change': 0.37; 'accuracy': 0.37; 'arising': 0.37; 'but': 0.38; 'data': 0.38; 'purposes': 0.38; 'subject:: ': 0.38; 'comments': 0.39; 'should': 0.39; 'legally': 0.39; 'to:addr:python.org': 0.39; 'under': 0.40; 'really': 0.40; 'below': 0.61; 'you.': 0.62; 'subject': 0.62; 'market': 0.63; 'virus': 0.63; 'free': 0.63; 'applicable': 0.65; 'co.,': 0.65; 'contact': 0.66; 'relating': 0.67; 'legal': 0.70; 'offer': 0.71; 'sale': 0.76; 'bank': 0.76; 'investment': 0.78; 'purchase': 0.83; 'affiliates.': 0.84; 'prices,': 0.84; 'defect': 0.91; 'instrument': 0.95; 'notice.': 0.96
X-DKIM Sendmail DKIM Filter v2.8.4 sf3.jpmchase.com p4VGW5sg025546
DKIM-Signature v=1; a=rsa-sha256; c=simple/simple; d=jpmchase.com; s=smtpout; t=1306859526; bh=I+HipXlnvGu7/ez36XTZgF4HFSUrjyhOjgLtXsH1N7A=; h=From:To:Date:Subject:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=gQgJ1h1ZGiXNksanGzgHolz4JfqhHwNOu7XBCWxbKmkJgp9dIXnLUK+vhrHQS/2I1 mFamnmhqYQtnwrtcqDTmQdhZ23IitdFA5eslj2s5RdCAy0NJyYROpHM9gU0ec0AbNq qI/IvFbxsOfIpjA9cgHbGYg/0tlhOOUYGrjw9nAw=
From "Prasad, Ramit" <ramit.prasad@jpmchase.com>
To "'Wolfgang Meiners'" <WolfgangMeiners01@web.de>, "'python-list@python.org'" <python-list@python.org>
Date Tue, 31 May 2011 12:31:36 -0400
Subject RE: sqlalchemy and Unicode strings: errormessage
Thread-Topic sqlalchemy and Unicode strings: errormessage
Thread-Index AcwfqphMbshr05uZRxmfLTSb9cRhvAAA1/NA
References <4de40ee8$0$6623$9b4e6d93@newsspool2.arcor-online.net> <mailman.2315.1306841548.9059.python-list@python.org> <4de50cfd$0$6538$9b4e6d93@newsspool4.arcor-online.net>
In-Reply-To <4de50cfd$0$6538$9b4e6d93@newsspool4.arcor-online.net>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
acceptlanguage en-US
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-DLP-FWD Yes
Content-Type text/plain; charset="us-ascii"
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.2322.1306860978.9059.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 82.94.164.166
X-Trace 1306860979 news.xs4all.nl 49180 [::ffff:82.94.164.166]:57672
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:6741

Show key headers only | View raw


>line = unicode(line.strip(),'utf8')
>and now i get really utf8-strings. It does work but i dont know why it works. For me it looks like i change an utf8-string to an utf8-string.


I would like to point out that UTF-8 is not exactly "Unicode". From what I understand, Unicode is a standard while UTF-8 is like an implementation of that standard (called an encoding). Being able to convert to Unicode (the standard) should mean you are then able to convert to any encoding that supports the Unicode characters used.

As you can see below a string in UTF-8 is actually not Unicode. (decode converts to Unicode, encode converts away from Unicode)

>>> type(u'test'.encode('utf8'))
<type 'str'>
>>> type('test'.decode('utf8'))
<type 'unicode'>
>>> type('test'.encode('utf8'))
<type 'str'>
>>> type(u'test')
<type 'unicode'>


Ramit



Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.

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


Thread

sqlalchemy and Unicode strings: errormessage Wolfgang Meiners <WolfgangMeiners01@web.de> - 2011-05-30 23:40 +0200
  Re: sqlalchemy and Unicode strings: errormessage Chris Withers <chris@simplistix.co.uk> - 2011-05-31 10:55 +0100
    Re: sqlalchemy and Unicode strings: errormessage Wolfgang Meiners <WolfgangMeiners01@web.de> - 2011-05-31 17:47 +0200
  Re: sqlalchemy and Unicode strings: errormessage Daniel Kluev <dan.kluev@gmail.com> - 2011-05-31 22:32 +1100
    Re: sqlalchemy and Unicode strings: errormessage Wolfgang Meiners <WolfgangMeiners01@web.de> - 2011-05-31 17:45 +0200
      Re: sqlalchemy and Unicode strings: errormessage Wolfgang Meiners <WolfgangMeiners01@web.de> - 2011-05-31 18:10 +0200
      Re: sqlalchemy and Unicode strings: errormessage Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-05-31 09:42 -0700
      RE: sqlalchemy and Unicode strings: errormessage "Prasad, Ramit" <ramit.prasad@jpmchase.com> - 2011-05-31 12:31 -0400
      Re: sqlalchemy and Unicode strings: errormessage Chris Angelico <rosuav@gmail.com> - 2011-06-01 03:19 +1000
      Thanks for all responses Wolfgang Meiners <WolfgangMeiners01@web.de> - 2011-05-31 21:52 +0200
        Re: Thanks for all responses Chris Angelico <rosuav@gmail.com> - 2011-06-01 07:56 +1000
          Re: Thanks for all responses Wolfgang Meiners <WolfgangMeiners01@web.de> - 2011-06-01 19:29 +0200
            Re: Thanks for all responses Chris Angelico <rosuav@gmail.com> - 2011-06-02 04:38 +1000

csiph-web