Python Forum
utf-8 decoding failed every time i try
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
utf-8 decoding failed every time i try
#10
I am getting exact result as you given.. i think something is wrong with terminal ??? is it possible ? can you try my code on your ubuntu ?
on browser it looks fine, but on terminal some thing is wrong. strange issue i am facing bro :(

for example
i see this " Bebês " in terminal instead of " Bebês "
but i see Bebês correctly on browser. but not on my server terminals


(Aug-23-2019, 09:27 PM)snippsat Wrote:
(Aug-23-2019, 04:47 PM)adnanahsan Wrote: Problem seems to be with terminal console encoding.
Check your terminal encoding,here some test you can do,i use Linux mint 19 here.
tom@tom:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=sv_SE.UTF-8
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=sv_SE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_IDENTIFICATION=sv_SE.UTF-8
LC_ALL=
tom@tom:~$ python
Python 3.7.3 (default, Apr 17 2019, 11:23:54) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> 
>>> locale.getdefaultlocale()
('en_US', 'UTF-8')
>>> locale.getpreferredencoding()
'UTF-8'
>>> exit()
tom@tom:~$ python -c "import sys; print(sys.stdout.encoding)"
UTF-8
tom@tom:~$ python -c "print('Spicy jalapeño ☂')"
Spicy jalapeño ☂
tom@tom:~$ python -c "print('Relógio feminino dourado')"
Relógio feminino dourado
Reply


Messages In This Thread
RE: utf-8 decoding failed every time i try - by adnanahsan - Aug-23-2019, 11:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Decoding lat/long in file name johnmcd 4 441 Mar-22-2024, 11:51 AM
Last Post: johnmcd
  Enigma Decoding Problem krisarmstrong 4 827 Dec-14-2023, 10:42 AM
Last Post: Larz60+
  json decoding error deneme2 10 3,885 Mar-22-2023, 10:44 PM
Last Post: deanhystad
  flask app decoding problem mesbah 0 2,397 Aug-01-2021, 08:32 PM
Last Post: mesbah
  Decoding a serial stream AKGentile1963 7 8,801 Mar-20-2021, 08:07 PM
Last Post: deanhystad
  xml decoding failure(bs4) roughstroke 1 2,299 May-09-2020, 04:37 PM
Last Post: snippsat
  python3 decoding problem but python2 OK mesbah 0 1,831 Nov-30-2019, 04:42 PM
Last Post: mesbah
  hex decoding in Python 3 rdirksen 2 4,654 May-12-2019, 11:49 AM
Last Post: rdirksen
  Decoding log files in binary using an XML file. captainfantastic 1 2,465 Apr-04-2019, 02:24 AM
Last Post: captainfantastic
  decoding sub.process output with multiple \n? searching1 2 2,838 Feb-24-2019, 12:00 AM
Last Post: searching1

Forum Jump:

User Panel Messages

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