Python Forum
Issue on text decoding and encoding problem
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue on text decoding and encoding problem
#1
HELLO, 

while reading data from the text it is not reading properly as it. Please tell me how can solve it ...

sentences = nltk.sent_tokenize(texts.decode('utf-8'))
 

Output:
u2013specific
thanks for ur help
Reply
#2
Looks like the text contains unicode escapes and is not de-escaped. What is the output of print repr(texts)?
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  very newbie problem on text file zapad 2 1,051 Apr-12-2024, 06:50 PM
Last Post: zapad
  Decoding lat/long in file name johnmcd 4 1,558 Mar-22-2024, 11:51 AM
Last Post: johnmcd
  Enigma Decoding Problem krisarmstrong 4 2,182 Dec-14-2023, 10:42 AM
Last Post: Larz60+
  json decoding error deneme2 10 8,215 Mar-22-2023, 10:44 PM
Last Post: deanhystad
  Encoding Issue in eyed3 giddyhead 2 2,831 Jul-22-2022, 02:03 AM
Last Post: giddyhead
  flask app decoding problem mesbah 0 3,229 Aug-01-2021, 08:32 PM
Last Post: mesbah
  Decoding a serial stream AKGentile1963 7 12,963 Mar-20-2021, 08:07 PM
Last Post: deanhystad
  xml decoding failure(bs4) roughstroke 1 3,030 May-09-2020, 04:37 PM
Last Post: snippsat
  Python 36-32 problem encoding module not found mkgrtn 0 3,010 Apr-14-2020, 09:57 PM
Last Post: mkgrtn
  python3 decoding problem but python2 OK mesbah 0 2,309 Nov-30-2019, 04:42 PM
Last Post: mesbah

Forum Jump:

User Panel Messages

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