Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:44:26+00:00 2026-06-07T05:44:26+00:00

python 3.x >>> a = input() hope >>> a ‘hope’ >>> b = input()

  • 0

python 3.x

>>> a = input()
hope
>>> a
'hope'
>>> b = input()
håpe
>>> b
'håpe'
>>> c = input()

start typing hå... delete using backspace... and change to hope

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 1: invalid continuation byte
>>> 

The situation is not terrible, I am working around it, but find it strange that when deleting, the bytes get messed up. Has anyone else experienced this?

the terminal history shows that it thought that I entered h?ope

any ideas?

in the script that is using this, I do import readline to give command line history.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:44:28+00:00Added an answer on June 7, 2026 at 5:44 am

    It looks like backspace is deleting the last byte instead of the last character. What ends up happening is that you type:

    68 c3 a5
    h |  å
    
    68 c3 6f 70 65
    h |  |o |p |e
    

    In UTF-8, a byte with the first bit set (c3) means that the next byte must have its first bit set as well (see Wikipedia’s description).

    Make sure that your terminal emulator and readline understand you’re using UTF-8.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using the select.select() method in Python, is there any way to use input
I have been able to create a csv with python using the input from
I am working on list using python input : [[u'Tempoh', '', '', u'Belanjawan semasa',
I am trying to create a triangle of numbers using Python from user input.
Is it possible for python to accept input like this: Folder name: Download But
I have this code in Python inputted = input(Enter in something: ) print(Input is
Everything works fine locally when I do as follows: cat input | python mapper.py
I need to write some input data files for a python program, and I
I am doing some input/output between a c++ and a python program (only floating
I want to make a program in Python that can take video input from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.