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


Groups > comp.lang.python > #40437

Re: Encoding problem in python

Date 2013-03-04 10:57 +0100
From Laszlo Nagy <gandalf@shopzeus.com>
Subject Re: Encoding problem in python
References <a70649cf-4b66-431f-bc97-e9af38b18e54@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.2832.1362391640.2939.python-list@python.org> (permalink)

Show all headers | View raw


On 2013-03-04 10:37, yomnasalah91@gmail.com wrote:
> I have a problem with encoding in python 27 shell.
>
> when i write this in the python shell:
>
> w=u'العربى'
>
> It gives me the following error:
>
> Unsupported characters in input
>
> any help?
Maybe it is not Python related. Did you get an exception? Can you send a 
full traceback? I suspect that the error comes from your terminal, and 
not Python. Please make sure that your terminal supports UTF-8 encoding. 
Alternatively, try creating a file with this content:


# -*- encoding: UTF-8 -*-
w=u'العربى'

Save it as UTF-8 encoded file "test.py" (with an UTF-8 compatible 
editor, for example Geany) and run it as a command:


python test.py

If it works then it is sure that the problem is with your terminal. It 
will be an OS limitation, not Python's limitation.

Best,

    Laszlo

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


Thread

Encoding problem in python yomnasalah91@gmail.com - 2013-03-04 01:37 -0800
  Re: Encoding problem in python Laszlo Nagy <gandalf@shopzeus.com> - 2013-03-04 10:57 +0100
  Re: Encoding problem in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-04 10:18 +0000
  Re: Encoding problem in python Vlastimil Brom <vlastimil.brom@gmail.com> - 2013-03-04 14:39 +0100

csiph-web