Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #13201
| Newsgroups | comp.lang.python |
|---|---|
| Subject | Re: How do I automate the removal of all non-ascii characters from my code? |
| References | (2 earlier) <CAO+9iGfHABoWnz-Podk9J5D3EJFgQ-9th=ky2Z-uW8MbQJA12A@mail.gmail.com> <CAO+9iGe2JcUHY8u+KEZfv3r8VmBdJ9h9NLwL3nO2Wpm80zRT2Q@mail.gmail.com> <mailman.1021.1315817058.27778.python-list@python.org> <4e6dc7b4$0$29986$c3e8da3$5496439d@news.astraweb.com> <98d81fe1-79df-4e37-87aa-399a78b52353@bi2g2000vbb.googlegroups.com> |
| From | "Rhodri James" <rhodri@wildebst.demon.co.uk> |
| Message-ID | <op.v1ps4fqia8ncjz@gnudebst> (permalink) |
| Organization | virginmedia.com |
| Date | 2011-09-12 22:39 +0100 |
On Mon, 12 Sep 2011 15:47:00 +0100, jmfauth <wxjmfauth@gmail.com> wrote: > On 12 sep, 10:49, Steven D'Aprano <steve > +comp.lang.pyt...@pearwood.info> wrote: >> >> Even with a source code encoding, you will probably have problems with >> source files including \xe2 and other "bad" chars. Unless they happen to >> fall inside a quoted string literal, I would expect to get a >> SyntaxError. >> > > This is absurd and a complete non sense. The purpose > of a coding directive is to inform the engine, which > is processing a text file, about the "language" it > has to speak. Can be a html, py or tex file. > If you have problem, it's probably a mismatch between > your coding directive and the real coding of the > file. Typical case: ascii/utf-8 without signature. Now read what Steven wrote again. The issue is that the program contains characters that are syntactically illegal. The "engine" can be perfectly correctly translating a character as a smart quote or a non breaking space or an e-umlaut or whatever, but that doesn't make the character legal! -- Rhodri James *-* Wildebeest Herder to the Masses
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: How do I automate the removal of all non-ascii characters from my code? Stefan Behnel <stefan_ml@behnel.de> - 2011-09-12 10:43 +0200
Re: How do I automate the removal of all non-ascii characters from my code? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-12 18:49 +1000
Re: How do I automate the removal of all non-ascii characters from my code? Dave Angel <davea@ieee.org> - 2011-09-12 08:09 -0400
Re: How do I automate the removal of all non-ascii characters from my code? jmfauth <wxjmfauth@gmail.com> - 2011-09-12 07:47 -0700
Re: How do I automate the removal of all non-ascii characters from my code? "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2011-09-12 22:39 +0100
Re: How do I automate the removal of all non-ascii characters from my code? jmfauth <wxjmfauth@gmail.com> - 2011-09-13 00:49 -0700
Re: How do I automate the removal of all non-ascii characters from my code? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-13 18:15 +1000
Re: How do I automate the removal of all non-ascii characters from my code? jmfauth <wxjmfauth@gmail.com> - 2011-09-13 02:04 -0700
Re: How do I automate the removal of all non-ascii characters from my code? ron <vacorama@gmail.com> - 2011-09-13 05:31 -0700
Re: How do I automate the removal of all non-ascii characters from my code? Vlastimil Brom <vlastimil.brom@gmail.com> - 2011-09-13 15:33 +0200
Re: How do I automate the removal of all non-ascii characters from my code? Alec Taylor <alec.taylor6@gmail.com> - 2011-09-14 01:02 +1000
Re: How do I automate the removal of all non-ascii characters from my code? Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-09-13 18:29 +0300
Re: How do I automate the removal of all non-ascii characters from my code? Vlastimil Brom <vlastimil.brom@gmail.com> - 2011-09-13 20:13 +0200
csiph-web