Bottom Page

Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 UnicodeEncodeError: 'charmap' codec can't encode character '\u2019' in position 23: c
I try to run my code in cmd command. It ran few lines of my code and gave some en code error. I posted the output below. Does anyone know why this happens? Thanks in advance.

C:\Users\resea>"C:\Users\resea\Desktop\Python Projects\ecb try" Mario Draghi, President of the ECB,Vítor Constâncio, Vice-President of the ECB,Frankfurt am Main, 10 January 2013 Get an overview of what the European Central Bank does and how it operates. More Look at press releases, speeches and interviews and filter them by date, speaker or activity. More Traceback (most recent call last): File "C:\Users\resea\Desktop\Python Projects\ecb try", line 51, in <module> print (" ".join(colored_words)) File "C:\Python34\lib\site-packages\colorama\", line 41, in write self.__convertor.write(text) File "C:\Python34\lib\site-packages\colorama\", line 162, in write self.write_and_convert(text) File "C:\Python34\lib\site-packages\colorama\", line 190, in write_and_convert self.write_plain_text(text, cursor, len(text)) File "C:\Python34\lib\site-packages\colorama\", line 195, in write_plain_text self.wrapped.write(text[start:end]) File "C:\Python34\lib\encodings\", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2019' in position 23: character maps to <undefined>
You like this post
Quote:Does anyone know why this happens?
How could we know Confused
You need to post ecb try
You like this post
Obviously there is a problem with a string that the colorama module is unable to print because of en encoding issue. You could print the repr of this string, so we could look at this with colorama. Try to print the repr(" ".join(colored_words)) at line 51 in ecb try and post the result here.
You like this post

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  unicodedecodeerror:utf codec can't decode byte 0xe3 in position 1 mariolopes 3 88 Oct-14-2019, 10:17 PM
Last Post: mariolopes
  How to get the position of character SriRajesh 6 127 Sep-16-2019, 01:22 PM
Last Post: perfringo
  'utf-8' codec can't decode byte 0xda in position 184: invalid continuation byte karkas 7 367 Sep-12-2019, 11:19 PM
Last Post: newbieAuggie2019
  asyncio encode and decode, how good are they? CoderOne 2 131 Sep-03-2019, 11:06 PM
Last Post: wavic
  charmap codec can't decode byte error with gzipped file in python bluethundr 2 318 Apr-30-2019, 12:26 PM
Last Post: bluethundr
  Replace changing string including uppercase character with lowercase character silfer 11 715 Mar-25-2019, 12:54 PM
Last Post: silfer
  Countryinfo package charmap error mkaru 6 886 Sep-16-2018, 02:58 PM
Last Post: snippsat
  Encode string split problem sripylearn 3 647 Aug-14-2018, 02:42 PM
Last Post: buran
  python charmap codec can't decode byte X in position Y character maps to < undefined> owais 9 20,848 Apr-28-2018, 10:52 PM
Last Post: abadawi
  Exchange2org - Charmap Encode issue r7rajkumar 1 736 Feb-19-2018, 09:37 AM
Last Post: buran

Forum Jump:

Users browsing this thread: 1 Guest(s)