Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17737
| References | <CAO1k_tpTypLKTS7==Arm3bcetArJhv=wYGGBK3GzxQ1fe3KRqg@mail.gmail.com> |
|---|---|
| Date | 2011-12-23 01:58 +1100 |
| Subject | Re: Spanish Accents |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3981.1324565926.27778.python-list@python.org> (permalink) |
On Fri, Dec 23, 2011 at 1:55 AM, Stan Iverson <iversonstan@gmail.com> wrote: > Hi; > If I write a python page to print to the web with Spanish accents all is > well. However, if I read the data from a text file it prints diamonds with > question marks wherever there are accented vowels. Please advise. Sounds like an encoding problem. Firstly, are you using Python 2 or Python 3? Things will be slightly different, since the default 'str' object in Py3 is Unicode. I would guess that your page is being output as UTF-8; you may find that the solution is as easy as declaring the encoding of your text file when you read it in. ChrisA
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Spanish Accents Chris Angelico <rosuav@gmail.com> - 2011-12-23 01:58 +1100
csiph-web