This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Unicode Error
Type: Stage:
Components: Unicode Versions: Python 3.1
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, ezio.melotti, vitvn
Priority: normal Keywords:

Created on 2009-09-13 00:57 by vitvn, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg92557 - (view) Author: vitvn (vitvn) Date: 2009-09-13 00:57
>>>viet= "â ă á à ấ ầ ắ ằ ạ ậ  ặ "

>>>print(viet)


Traceback (most recent call last):
  File "tiengviet.py", line 4, in <module>
    print(viet)
  File "I:\python\python.v3.1_portable\App\lib\encodings\cp1252.py",
line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0103' in
position 2: character maps to <undefined>
>Exit code: 1

how to fix it ?
msg92558 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-09-13 01:02
Change your terminal's encoding.
msg92559 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-09-13 01:07
It looks like you are using the Windows terminal, that, afaik, is not
able to display the characters you are trying to print. This is because
its default encoding - cp1252 - can encode only a small subset of the
Unicode characters.
If changing the encoding of the terminal doesn't work, you can try to
use a better terminal or IDLE instead.
History
Date User Action Args
2022-04-11 14:56:52adminsetgithub: 51147
2009-09-13 01:07:31ezio.melottisetnosy: + ezio.melotti
messages: + msg92559
2009-09-13 01:02:16benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg92558

resolution: not a bug
2009-09-13 00:57:32vitvncreate