Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'string': 0.09; 'explanation': 0.09; 'subject:into': 0.09; 'subject:string': 0.09; 'subject:How': 0.10; 'python': 0.11; 'kurt': 0.12; '2.7': 0.14; '2.7:': 0.16; 'ordinal': 0.16; 'pairs': 0.16; 'surrogate': 0.16; 'unicode,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'code,': 0.22; 'manual': 0.22; 'interpret': 0.24; 'unicode': 0.24; 'mention': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'array': 0.29; 'subject:list': 0.30; 'code': 0.31; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'url:python': 0.33; 'received:google.com': 0.35; 'version': 0.36; 'representing': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'two': 0.37; 'message- id:@gmail.com': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'received:62': 0.63; 'header:Message-Id:1': 0.63; 'email addr:gmail.com': 0.63; 'irrelevant': 0.84; 'unclear': 0.84; 'remember,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=BSkye6+1KOSYsI3x+EFkF+MBsvPaujiDUiaI1GGGhG8=; b=x1+FQMNMdkwDGiTk1T1dx+Ypp0nEabglZlAljcl34BxH+uFD4OLWg8/s60A2EH3qh5 +wCna3IESx5I8HjN2+4LfFL+vZARqi3UWprrabexIh9fgPWs2NOdJ7cf9HM/QpeNJfRM NTrAi4tlMbAPZhx0N+7OT4MARdiF9GtTovel69ZhKgCLrbeJjHyOZbZ3UnWxdISe9y6d xaEM9XhTxSQ2/ztFhVXVETl4/jecSKxokoS4LbQXBV7SZ1Hx0rsO/+djj+ncGlBQV2jK W6AlTbq2RxoiqSI1PV2fbgFIvZ/cSFegyDrbMUg2u0YlNfuHWIDZpMRpcFIt2GcV+FLZ YP7A== X-Received: by 10.180.20.6 with SMTP id j6mr11868910wie.64.1410031697323; Sat, 06 Sep 2014 12:28:17 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: How to turn a string into a list of integers? From: Kurt Mueller In-Reply-To: <540b504a$0$29974$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 6 Sep 2014 21:28:14 +0200 Content-Transfer-Encoding: quoted-printable References: <1amjdb-p3n.ln1@chris.zbmc.eu> <1k9odb-1qs.ln1@chris.zbmc.eu> <540aa002$0$29968$c3e8da3$5496439d@news.astraweb.com> <540b504a$0$29974$c3e8da3$5496439d@news.astraweb.com> To: python-list@python.org X-Mailer: Apple Mail (2.1878.6) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1410031704 news.xs4all.nl 2837 [2001:888:2000:d::a6]:52592 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77664 Am 06.09.2014 um 20:19 schrieb Steven D'Aprano = : > Kurt Mueller wrote: > [...] >> Now the part of the two Python builds is still somewhat unclear to = me. > [...] >> In Python 2.7: >> As I learned from the ord() manual: >> If a unicode argument is given and Python was built with UCS2 = Unicode, > Where does the manual mention UCS-2? As far as I know, no version of = Python > uses that. https://docs.python.org/2/library/functions.html?highlight=3Dord#ord [snip] very detailed explanation of narrow/wide build, UCS-2/UCS-4, = UTF-16/UTF-32 > Remember, though, these internal representations are (nearly) = irrelevant to > Python code. In Python code, you just consider that a Unicode string = is an > array of ordinal values from 0x0 to 0x10FFFF, each representing a = single > code point U+0000 to U+10FFFF. The only reason I say "nearly" is that > narrow builds don't *quite* work right if the string contains = surrogate > pairs. So I can interpret your last section: Processing any Unicode string will work with small and wide python 2.7 builds and also with python >3.3? ( parts of small build python will not work with values over 0xFFFF ) ( strings with surrogate pairs will not work correctly on small build = python ) Many thanks for your detailed answer! --=20 Kurt Mueller, kurt.alfred.mueller@gmail.com