Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #13160
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <gherron@islandtraining.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'automate': 0.05; 'complaining': 0.07; 'received:66.35': 0.07; 'subject:code': 0.07; 'python': 0.08; "(it's": 0.09; 'encoding:': 0.09; 'subject:characters': 0.09; 'suggestions,': 0.09; 'url:peps': 0.09; 'utf-8': 0.09; 'am,': 0.12; 'error:': 0.12; '-*-': 0.16; 'code?': 0.16; 'coding:': 0.16; 'declared;': 0.16; 'odt': 0.16; 'subject: \n ': 0.16; 'subject:non': 0.16; 'syntaxerror:': 0.16; 'url:pep-0263': 0.16; 'wrote:': 0.16; 'converted': 0.18; 'convert': 0.19; 'header:In-Reply-To:1': 0.22; 'there.': 0.24; 'specify': 0.24; 'guess': 0.26; "i'm": 0.27; 'writer': 0.30; 'thanks': 0.30; 'specified': 0.31; 'subject:?': 0.31; 'error': 0.32; 'yet': 0.32; 'does': 0.32; 'comment': 0.32; "can't": 0.33; 'to:addr:python-list': 0.33; 'header:User-Agent:1': 0.34; '(as': 0.34; 'but,': 0.34; 'character': 0.34; 'quite': 0.34; 'file.': 0.34; 'subject:How': 0.35; 'post': 0.36; 'file': 0.36; 'url:python': 0.36; 'question': 0.36; 'using': 0.37; 'but': 0.37; 'something': 0.37; 'some': 0.38; 'url:org': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'received:192': 0.39; 'characters': 0.39; 'to:addr:python.org': 0.39; 'subject:from': 0.40; 'might': 0.40; 'more': 0.60; 'removal': 0.64; 'taylor': 0.67; 'paper': 0.72; 'evening,': 0.84; 'subject:removal': 0.84; 'writer,': 0.91; 'subject:\t': 0.93 |
| Date | Mon, 12 Sep 2011 01:17:44 -0700 |
| From | Gary Herron <gherron@islandtraining.com> |
| User-Agent | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: How do I automate the removal of all non-ascii characters from my code? |
| References | <CAO+9iGc0f7vFLrjjm24vzZqoMV04eL4fBQrYOTfDt-eYCNEacQ@mail.gmail.com> |
| In-Reply-To | <CAO+9iGc0f7vFLrjjm24vzZqoMV04eL4fBQrYOTfDt-eYCNEacQ@mail.gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1018.1315815474.27778.python-list@python.org> (permalink) |
| Lines | 38 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1315815474 news.xs4all.nl 2452 [2001:888:2000:d::a6]:55935 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:13160 |
Show key headers only | View raw
On 09/12/2011 12:49 AM, Alec Taylor wrote: > Good evening, > > I have converted ODT to HTML using LibreOffice Writer, because I want > to convert from HTML to Creole using python-creole. Unfortunately I > get this error: "File "Convert to Creole.py", line 17 > SyntaxError: Non-ASCII character '\xe2' in file Convert to Creole.py > on line 18, but no encoding declared; see > http://www.python.org/peps/pep-0263.html for details". > > Unfortunately I can't post my document yet (it's a research paper I'm > working on), but I'm sure you'll get the same result if you write up a > document in LibreOffice Writer and add some End Notes. > > How do I automate the removal of all non-ascii characters from my code? > > Thanks for all suggestions, > > Alec Taylor This question does not quite make sense. The error message is complaining about a python file. What does that file have to do with ODT to HTML conversion and LibreOffice? The error message means the python file (wherever it came from) has a non-ascii character (as you noted), and so it needs something to tell it what such a character means. (That what the encoding is.) A comment like this in line 1 or 2 will specify an encoding: # -*- coding: <encoding name> -*- but, we'll have to know more about the file "Convert to Creole.py" to guess what encoding name should be specified there. You might try utf-8 or latin-1.
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: How do I automate the removal of all non-ascii characters from my code? Gary Herron <gherron@islandtraining.com> - 2011-09-12 01:17 -0700 Re: How do I automate the removal of all non-ascii characters from my code? jmfauth <wxjmfauth@gmail.com> - 2011-09-12 07:39 -0700
csiph-web