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

  • SEARCH
  • Home
  • 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 752477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:47:09+00:00 2026-05-14T14:47:09+00:00

If I try to paste a unicode character such as the middle dot: ·

  • 0

If I try to paste a unicode character such as the middle dot:

·

in my python interpreter it does nothing. I’m using Terminal.app on Mac OS X and when I’m simply in in bash I have no trouble:

:~$ ·

But in the interpreter:

:~$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

^^ I get nothing, it just ignores that I just pasted the character. If I use the escape \xNN\xNN representation of the middle dot ‘\xc2\xb7’, and try to convert to unicode, trying to show the dot causes the interpreter to throw an error:

>>> unicode('\xc2\xb7')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)

I have setup ‘utf-8’ as my default encoding in sitecustomize.py so:

>>> sys.getdefaultencoding()
'utf-8'

What gives? It’s not the Terminal. It’s not Python, what am I doing wrong?!

This question is not related to this question, as that indivdiual is able to paste unicode into his Terminal.

  • 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-05-14T14:47:09+00:00Added an answer on May 14, 2026 at 2:47 pm

    unicode('\xc2\xb7') means to decode the byte string in question with the default codec, which is ascii — and that of course fails (trying to set a different default encoding has never worked well, and in particular doesn’t apply to “pasted literals” — that would require a different setting anyway). You could use instead u’\xc2\xb7′, and see:

    >>> print(u'\xc2\xb7')
    ·
    

    since those are two unicode characters of course. While:

    >>> print(u'\uc2b7')
    슷
    

    gives you a single unicode character (of some oriental persuasion — sorry, I’m ignorant about these things). BTW, neither of these is the “middle dot” you were looking for. Maybe you mean

    >>> print('\xc2\xb7'.decode('utf8'))
    ·
    

    which is the middle dot. BTW, for me (python 2.6.4 from python.org on a Mac Terminal.app):

    >>> print('슷')
    슷
    

    which kind of surprised me (I expected an error…!-).

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

Sidebar

Related Questions

I have terminal.app set to accept utf-8 and in bash I can type unicode
If i try to paste source code in word 2007 the spacing between the
When I try to copy code from eclipse and paste it in the actionscript
Currently I have a simple IRC bot written in python. Since I migrated it
I have a file containing Unicode characters on a server running linux. If I
I've convinced my boss to do the typesetting stuff using PHP(PHP Version 5.2.8). And
How do you test your app for Iñtërnâtiônàlizætiøn compliance? I tell people to store
I'm trying to diagnose a problem in UKSyntaxColoredTextDocument 0.4 http://www.zathras.de/angelweb/blog-uksctd-oh-four.htm where text that actually
I have a somewhat complex query that I want to use as a source

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.