Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'output': 0.04; 'allowed.': 0.07; 'defines': 0.07; 'python': 0.09; 'differently.': 0.09; 'itself,': 0.09; 'subject:()': 0.09; 'url:unicode': 0.09; 'language': 0.14; 'dec': 0.15; 'escapes': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'lower-case': 0.16; 'manner,': 0.16; 'octal': 0.16; 'original:': 0.16; 'result:': 0.16; 'subject:3.3': 0.16; 'subject:unicode': 0.16; 'unicode.': 0.16; 'uppercase': 0.16; 'wed,': 0.16; 'string': 0.17; 'wrote:': 0.17; 'thu,': 0.17; 'thanks,': 0.18; '>>>': 0.18; '(or': 0.18; 'equivalent': 0.20; 'tried': 0.25; 'header:In-Reply- To:1': 0.25; '(see': 0.27; 'am,': 0.27; '(3)': 0.27; 'message- id:@mail.gmail.com': 0.27; 'correct': 0.28; 'received:209.85.212': 0.28; 'behaving': 0.29; 'character': 0.29; '(2)': 0.32; 'running': 0.32; 'skip:s 30': 0.33; 'explains': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; '(1)': 0.34; 'mapping': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'url:org': 0.36; 'possible': 0.37; 'does': 0.37; 'uses': 0.37; 'why': 0.37; '(for': 0.37; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'skip:l 20': 0.38; 'skip:o 20': 0.38; 'to:addr:python.org': 0.39; 'release': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'skip:u 10': 0.60; 'link': 0.60; 'subject:, ': 0.61; 'map': 0.61; 'worth': 0.63; 'information': 0.63; '20,': 0.65; 'compliant': 0.65; 'subject.': 0.65; 'wish': 0.70; 'unusual': 0.71; 'url:jsp': 0.71; 'url:a': 0.72; '"das': 0.84; 'grosse': 0.84; 'pike': 0.84 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:to :content-type:content-transfer-encoding; bh=f91JUBqJsWR6TBxaQnVJL/AWzmsUYssNc4pbqrwDFoY=; b=0s6znLCXOXgIWZ7ebtErASwlQdRKOvKWV2rKn+NopyzW80LTvqs3eLmH3PqgALDi+F 75HSPlDl2zj/6hYURqHC4GMfKOFvi+6NqQlrZl2+8H865Dq2UK5aCqeaF1gTT9DLiUWo 7slQDmSvBq65ROXwTlCHI9UzRLznvwjl2QF8W2W+PNEPsk7pp5nTmvYEMyQ1s958scTJ Vyng8lI9T2Wes/zuxFZp1AgED0tckhI/2SxZUNRGXdqk5/luxqRd4OqP7lxz0fcUi7j5 d4aFQ+8B36CX2jfjTFuHEiGUp42I3wslCpk0peJPNKNibsV5NnbGLZYnJ/HWqc2jqNOJ /yXg== MIME-Version: 1.0 In-Reply-To: References: <2adb4a25-8ea3-441f-b8c0-ee6c87e4b19f@googlegroups.com> <890ee58d-e93e-42ac-b17e-59b05c6ecacb@googlegroups.com> Date: Thu, 20 Dec 2012 13:01:33 +1100 Subject: Re: Py 3.3, unicode / upper() From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355968896 news.xs4all.nl 6928 [2001:888:2000:d::a6]:49687 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35172 On Thu, Dec 20, 2012 at 8:23 AM, Ian Kelly wrote: > On Wed, Dec 19, 2012 at 1:55 PM, wrote: >> Yes, it is correct (or can be considered as correct). >> I do not wish to discuss the typographical problematic >> of "Das Grosse Eszett". The web is full of pages on the >> subject. However, I never succeeded to find an "official >> position" from Unicode. The best information I found seem >> to indicate (to converge), U+1E9E is now the "supported" >> uppercase form of U+00DF. (see DIN). > > Is this link not official? > > http://unicode.org/cldr/utility/character.jsp?a=3D00DF > > That defines a full uppercase mapping to SS and a simple uppercase > mapping to U+00DF itself, not U+1E9E. My understanding of the simple > mapping is that it is not allowed to map to multiple characters, > whereas the full mapping is so allowed. Ahh, thanks, that explains why the other Unicode-aware language I tried behaved differently. Pike v7.9 release 5 running Hilfe v3.5 (Incremental Pike Frontend) > string s=3D"Stra\u00dfe"; > upper_case(s); (1) Result: "STRA\337E" > lower_case(upper_case(s)); (2) Result: "stra\337e" > String.capitalize(lower_case(s)); (3) Result: "Stra\337e" The output is the equivalent of repr(), and it uses octal escapes where possible (for brevity), so \337 is its representation of U+00DF (decimal 223, octal 337). Upper-casing and lower-casing this character result in the same thing. > write("Original: %s\nLower: %s\nUpper: %s\n",s,lower_case(s),upper_case(s= )); Original: Stra=DFe Lower: stra=DFe Upper: STRA=DFE It's worth noting, incidentally, that the unusual upper-case form of the letter (U+1E9E) does lower-case to U+00DF in both Python 3.3 and Pike 7.9.5: > lower_case("Stra\u1E9Ee"); (9) Result: "stra\337e" >>> ord("\u1e9e".lower()) 223 So both of them are behaving in a compliant manner, even though they're not quite identical. ChrisA