Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'encoding': 0.05; 'subject:Python': 0.06; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ha!': 0.16; 'subject:Unicode': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'help!': 0.26; 'skip:" 30': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'went': 0.31; 'about.': 0.31; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; "couldn't": 0.39; 'name': 0.63; 'talking': 0.65; '2015': 0.84; '2:30': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=N/9ihDRml5pQgOe6gG/vw04x1gFQvikRU9iJe9mbaUw=; b=jrdXY8WCw276YCE/vdJM4zyhZ/lPUVyw/c5Yfm/Y1WjLnpYd3xv8uA9Ikz5TnzVWhq N3a3qeB4ZC4WvLlbDJlMRV9w9WV5uzoc1SoqQbbsOuNqu8klcd7cnBTzccqjOSXBa/hg MO0/+z4N3/5I/vatdQLVUGDWqJJ+suyIJHFPQXzJT5iakSXnBhPcyf7+iCfLKths+h+2 THEoVh5ZKtiaHKs++DMVKhpBZkEvTp1dIS1nyKDxl92Lzjo5QzoNtnAEI2mTkVoqWIEa 1MT7ZjhxuhClWS/A8YSntEYVImkk9Gdg/pL70YbaKbpjefYSKN5e1A8irgVrfep7xNly xEUw== MIME-Version: 1.0 X-Received: by 10.107.160.202 with SMTP id j193mr23687391ioe.43.1430671656247; Sun, 03 May 2015 09:47:36 -0700 (PDT) In-Reply-To: References: Date: Mon, 4 May 2015 02:47:36 +1000 Subject: Re: Unicode surrogate pairs (Python 3.4) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430671665 news.xs4all.nl 2857 [2001:888:2000:d::a6]:55735 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89883 On Mon, May 4, 2015 at 2:30 AM, Jon Ribbens wrote: > I did some experimentation, and it looks like the answer is: > > "\udb40\udd9d".encode("utf16", "surrogatepass").decode("utf16") > > Thanks for your help! Ha! That's the one. I went poking around but couldn't find the name for it. That's exactly the sloppy encoding that I was talking about. ChrisA