Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Django': 0.03; 'prefix': 0.07; 'processing.': 0.07; 'modulo': 0.09; 'proficient': 0.09; 'python': 0.10; '>great': 0.16; '>on': 0.16; 'chris,': 0.16; 'corrupt': 0.16; 'in...': 0.16; 'investigate': 0.16; 'received:bosmailout05.eigbox.net': 0.16; 'received:yourhostingaccount.com': 0.16; 'wrote:': 0.16; 'string': 0.17; 'stick': 0.18; 'windows': 0.20; '2015': 0.20; 'aug': 0.20; 'to:2**1': 0.21; '(all': 0.22; 'ascii': 0.22; 'am,': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'header:User-Agent:1': 0.26; '(which': 0.26; 'skip:" 20': 0.26; 'always,': 0.29; 'far,': 0.29; 'reduced': 0.29; 'symbols': 0.29; "they'll": 0.29; 'books': 0.30; 'url:mailman': 0.30; 'code': 0.30; 'another': 0.32; 'good.': 0.32; 'getting': 0.33; 'url:python': 0.33; 'michael': 0.33; 'largely': 0.33; 'skip:j 20': 0.33; 'url:listinfo': 0.34; 'languages': 0.34; 'server': 0.34; 'could': 0.35; 'text': 0.35; 'skip:> 10': 0.35; 'unicode': 0.35; 'quite': 0.35; 'but': 0.36; 'url:org': 0.36; '(and': 0.36; 'data.': 0.36; 'received:10.20': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'things': 0.38; 'itself': 0.38; 'received:66': 0.38; 'anything': 0.38; 'thank': 0.38; 'end': 0.39; 'why': 0.39; 'subject:the': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'care': 0.60; 'your': 0.60; 'avoid': 0.61; 'different': 0.63; 'you.': 0.64; 'chinese': 0.79; '8bit%:77': 0.84; 'emoticons,': 0.84; "life's": 0.84; 'popular.': 0.84; 'received:10.20.15.15': 0.84; 'received:66.96.187': 0.84; 'received:bosmailscan15.eigbox.net': 0.84; 'absolutely': 0.88; 'same,': 0.91 X-Authority-Analysis: v=2.1 cv=TYEYtHgh c=1 sm=1 tr=0 a=f4kFLigMKr8AH7rIJ//qJA==:117 a=YHaK2y7iffdR6ZG/aRXuBA==:17 a=pq4jwCggAAAA:8 a=QPcu4mC3AAAA:8 a=8_iErv3XAAAA:8 a=1E9jo8_qk6kA:10 a=wpL1jeqTJocA:10 a=IkcTkHD0fZMA:10 a=uRRa74qj2VoA:10 a=IHpK4gAxAAAA:8 a=pGLkceISAAAA:8 a=8AHkEIZyAAAA:8 a=n8fl942g34s14uqMFY8A:9 a=O0p9fFXspr7LKZ5n:21 a=JPx7U_6z4PqxEU37:21 a=QEXdDO2ut3YA:10 User-Agent: Microsoft-MacOutlook/14.4.7.141117 Date: Tue, 11 Aug 2015 09:53:14 +0800 Subject: Re: Is Django the way to go for a newbie? From: Dwight GoldWinde To: Chris Angelico , Python Python Thread-Topic: Is Django the way to go for a newbie? References: <55C790D3.3040906@gmail.com> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-EN-UserInfo: 6c5a25a10f5591a3de9585e9195aba16:931c98230c6409dcc37fa7e93b490c27 X-EN-AuthUser: dwight@goldwinde.com Sender: Dwight GoldWinde X-EN-OrigIP: 222.172.183.4 X-EN-OrigHost: unknown 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: 70 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1439260044 news.xs4all.nl 2851 [2001:888:2000:d::a6]:57117 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95235 So many new things to look into! Chris, I now will also investigate i18n. Thank you. BIG SMILE... Always, Dwight www.3forliving.key.to (video playlist on YouTube) www.couragebooks.key.to (all my books on Amazon) On 8/10/15, 9:27 AM, "Chris Angelico" wrote: >On Mon, Aug 10, 2015 at 3:41 AM, Michael Torrie wrote: >> Web development is very a very hard problem, largely because it involves >> quite a few different domain-specific languages that you have to be >> proficient in... >> >> In this area, node.js is getting very popular. I don't care much for >> javascript but using it on the server as well as the web browser itself >> reduced the number of languages you have to know by one. > >There's another thing you absolutely have to know when you do web >development, and that's i18n. This is why I don't recommend Node.js >for server-side work - because Python's Unicode support is better than >JS's. Stick with Python (and avoid Python 2 on Windows) and you get >great Unicode support. Do anything in JavaScript/ECMAScript and you >get UTF-16 as the official representation. What's the length of the >string "Hello, world"? > >>>> len("Hello, world") >12 > >> "Hello, world".length >12 > >So far, so good. What if those weren't ASCII characters? > >>>> len("=F0=9F=84=B7=F0=9F=84=B4=F0=9F=84=BB=F0=9F=84=BB=F0=9F=84=BE, =F0=9F=85=86=F0=9F=84=BE=F0=9F=85=81=F0=9F=84=BB=F0=9F=84=B3") >12 > >(That's Python 3. In Python 2, you'd need to put a u"" prefix on the >string, but it's otherwise the same, modulo the Windows narrow-build >issue.) > >> "=F0=9F=84=B7=F0=9F=84=B4=F0=9F=84=BB=F0=9F=84=BB=F0=9F=84=BE, =F0=9F=85=86=F0=9F=84=BE=F0=9F=85=81=F0=9F=84=BB=F0=9F=84=B3".length >22 > >ECMAScript stipulates that strings are not codepoints, but UTF-16 code >units, so whenever you work with astral characters (which includes a >lot of emoticons, Chinese characters, and other symbols that your end >users *will* use), they'll get things wrong. The length of the string >counts astral characters twice; indexing/slicing can take half of a >character; any manipulation at all could corrupt your data. > >So, use Python for all your text processing. Life's better that way. > >ChrisA >--=20 >https://mail.python.org/mailman/listinfo/python-list