Python Forum
unicodeencodeerror 'charmap' codec can't encode characters in position
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unicodeencodeerror 'charmap' codec can't encode characters in position
#1
The whole error is:
"unicodeencodeerror 'charmap' codec can't encode characters in position 1-6: character maps to <undefined>"

Appears when I run my program in the win console.

When I run it through the PyCharm IDE it does not appear.

The characters it's refering to, are non Latin characters.

I tried with .encode('utf-8') and .decode('utf-8') and seems ok.

Is this the 'proper' way to handle this?
Reply


Messages In This Thread
unicodeencodeerror 'charmap' codec can't encode characters in position - by panoss - Jan-27-2017, 06:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  encode/decode to show correct country letters in a CTk combobox janeik 2 741 Sep-02-2023, 09:46 AM
Last Post: janeik
Question UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 562: ord ctrldan 23 5,010 Apr-24-2023, 03:40 PM
Last Post: ctrldan
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid cont Melcu54 3 5,087 Mar-26-2023, 12:12 PM
Last Post: Gribouillis
  [SOLVED] [Debian] UnicodeEncodeError: 'ascii' codec Winfried 1 1,043 Nov-16-2022, 11:41 AM
Last Post: Winfried
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 19,193 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  UnicodeEncodeError - Dealing with Japanese Characters fioranosnake 2 2,512 Jul-07-2022, 08:43 PM
Last Post: fioranosnake
  UnicodeEncodeError: 'ascii' codec can't encode character '\xfd' in position 14: ordin Armandito 6 2,793 Apr-29-2022, 12:36 PM
Last Post: Armandito
  UnicodeEncodeError caused by print when program runs from Popen SheeppOSU 5 2,961 Jan-13-2022, 08:11 AM
Last Post: SheeppOSU
  [UnicodeEncodeError from smtplib] yoohooos 0 3,415 Sep-25-2021, 04:27 AM
Last Post: yoohooos
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 6,214 Jul-07-2021, 07:05 PM
Last Post: AlphaInc

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020