Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76319

Re: Unable to run print('Réussi') on windows and on linux

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
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; 'anyway.': 0.05; 'encoding': 0.05; '-*-': 0.07; 'correct.': 0.07; 'suggestions,': 0.07; 'utf-8': 0.07; 'coding:': 0.09; 'default.': 0.09; 'encoding:': 0.09; 'python': 0.11; 'declaration': 0.16; 'file;': 0.16; 'subject:run': 0.16; 'subject:windows': 0.16; 'utf8': 0.16; 'fix': 0.17; 'wrote:': 0.18; '(not': 0.18; 'thu,': 0.19; 'later': 0.20; '>>>': 0.22; 'aug': 0.22; 'rules': 0.22; 'source': 0.25; 'script': 0.25; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'regular': 0.32; 'text': 0.33; 'are:': 0.33; '(2)': 0.35; 'editor': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'really': 0.36; '14,': 0.36; 'thanks': 0.36; 'should': 0.36; '(3)': 0.38; 'configured': 0.38; 'to:addr:python- list': 0.38; 'that,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'expression': 0.60; 'first': 0.61; 'email addr:gmail.com': 0.63; 'improvement.': 0.68; 'default': 0.69; 'subjectcharset:utf-8': 0.72; 'apart': 0.72; 'further,': 0.74; 'caracter': 0.84; 'fail.': 0.84; 'many,': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=5Kz5RLFq98ZKe2d0CKSs12wN9eyeSYWDD8c6sprjd48=; b=X8Z45y8j5CL035CkAR0HH47nOOdmzQ+q3MFVA7TwFfffu/P2g/XxO2jBAO/37PEeVF Ngqc3CVr0EdTJL42qsZIF6eTPGewybo7IWPNmDdAVL5Hqha3Ak+MJlsPDdUwOqsUuUyj 62kbxz/HoMYfWFUSYH7O9mWWw9ukjPRRqmlJN1gpgbCPtuzbQnnc+nLT3UNBkfS9anQr aJmFsNJlu56jyq5jEEBAqjz8qNCVW1FQZNoUwIpoN+VfWQluvbdiWmk3TkQPTJQlsmiw Nhs2/xNCNFeaYvZOUHJN92kQn7iO81lvZen+PIUDv3WwQzBVJKWMVfBpgsIGbrYa6clV 0fjg==
X-Received by 10.70.140.36 with SMTP id rd4mr11355718pdb.61.1408032782603; Thu, 14 Aug 2014 09:13:02 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <53ecd406$0$29971$c3e8da3$5496439d@news.astraweb.com>
References <4dd67a80-b466-4866-ab67-d9a94c0b7ddf@googlegroups.com> <53ecba3e$0$1989$426a74cc@news.free.fr> <d460fa66-e881-4b80-9f86-cf82b3aa45ca@googlegroups.com> <53eccc08$0$2932$426a34cc@news.free.fr> <53ecd406$0$29971$c3e8da3$5496439d@news.astraweb.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 14 Aug 2014 10:12:22 -0600
Subject Re: Unable to run print('Réussi') on windows and on linux
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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 <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13003.1408032785.18130.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408032785 news.xs4all.nl 2912 [2001:888:2000:d::a6]:47017
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76319

Show key headers only | View raw


On Thu, Aug 14, 2014 at 9:21 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> YBM wrote:
>
>> Le 14/08/2014 16:04, marc.vanhoomissen@gmail.com a écrit :
>>> Hello YBM,
>>> I tried your suggestions, without improvement.
>>> Further, see my answer to Vincent Vande Vyre
>>> Thanks anyway.
>>
>> This is indeed very surprising. Are you sure that you
>> have *exactly* this line at the first or second (not
>> later !) line of your script :
>>
>> # -*- encoding: utf-8 -*-
>>
>> if a single caracter differs, it would fail.
>
> That's not correct. The encoding declaration is very flexible. Any of these
> will be accepted:
>
> # This file uses the encoding: utf_8
> # coding=UTF-8
> # -*- coding: utf8 -*-
> # vim: set fileencoding=utf-8 :
> # Uses encoding:utf8
> # I want my encoding=UtF_8 okay!
> #### textencoding=  UTf-8 blah blah blah
>
> and many, many other varieties. The rules are:
>
> (1) It must be a comment;
>
> (2) It must be in the first or second line of the file;
>
> (3) It must match the regular expression r"coding[:=]\s*([-\w.]+)"
>
>
> However, just because you declare the file to be UTF-8, doesn't mean it
> *actually is* UTF-8. If your text editor is configured to use (say)
> Latin-1, a UTF-8 encoding declaration will just give you garbage.
>
> * Fix your system to use UTF-8 by default.
>
> * Fix your editor to use UTF-8.
>
> * Add a UTF-8 encoding declaration.
>
> And then things should work.

And apart from all of that, if the OP is really using Python 3 then
UTF-8 is the default source encoding anyway.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Unable to run print('Réussi') on windows and on linux marc.vanhoomissen@gmail.com - 2014-08-14 05:35 -0700
  Re: Unable to run print('Réussi') on windows and on linux YBM <ybmess@nooos.fr.invalid> - 2014-08-14 15:31 +0200
    Re: Unable to run print('Réussi') on windows and on linux marc.vanhoomissen@gmail.com - 2014-08-14 07:04 -0700
      Re: Unable to run print('Réussi') on windows and on linux Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-14 15:38 +0100
      Re: Unable to run print('Réussi') on windows and on linux YBM <ybmess@nooos.fr.invalid> - 2014-08-14 16:47 +0200
        Re: Unable to run print('Réussi') on windows and on linux Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-15 01:21 +1000
          Re: Unable to run print('Réussi') on windows and on linux Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-14 10:12 -0600
          Re: Unable to run print('Réussi') on windows and on linux wxjmfauth@gmail.com - 2014-08-15 01:25 -0700
    Re: Unable to run print('Réussi') on windows and on linux Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2014-08-14 16:46 +0200
  Re: Unable to run print('Réussi') on windows and on linux Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2014-08-14 15:22 +0200
    Re: Unable to run print('Réussi') on windows and on linux marc.vanhoomissen@gmail.com - 2014-08-14 07:01 -0700
      Re: Unable to run print('Réussi') on windows and on linux Peter Otten <__peter__@web.de> - 2014-08-14 18:00 +0200
  Re: Unable to run print('Réussi') on windows and on linux Anssi Saari <as@sci.fi> - 2014-08-14 17:36 +0300
  Re: Unable to run print('Réussi') on windows and on linux wxjmfauth@gmail.com - 2014-08-15 01:23 -0700

csiph-web