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 7715283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:20:46+00:00 2026-06-01T02:20:46+00:00

Ubuntu 11.10: $ python Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] on

  • 0

Ubuntu 11.10:

$ python
Python 2.7.2+ (default, Oct  4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = u'\U0001f44d'
>>> len(x)
1
>>> ord(x[0])
128077

Windows 7:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> x = u'\U0001f44d'
>>> len(x)
2
>>> ord(x[0])
55357

My Ubuntu experience is with the default interpreter in the distribution. For Windows 7 I downloaded and installed the recommended version linked from python.org. I did not compile either of them myself.

The nature of the difference is clear to me. (On Ubuntu the string is a sequence of code points; on Windows 7 a sequence of UTF-16 code units.) My questions are:

  • Why am I observing this difference in behavior? Is it due to how the interpreter is built, or a difference in dependent system libraries?
  • Is there any way to configure the behavior of the Windows 7 interpreter to agree with the Ubuntu one, that I can do within Eclipse PyDev (my goal)?
  • If I have to rebuild, are there any prebuilt Windows 7 interpreters that behave as Ubuntu above from a reliable source?
  • Are there any workarounds to this issue besides manually counting surrogates in unicode strings on Windows only (blech)?
  • Does this justify a bug report? Is there any chance such a bug report would be addressed in 2.7?
  • 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-01T02:20:47+00:00Added an answer on June 1, 2026 at 2:20 am

    On Ubuntu, you have a “wide” Python build where strings are UTF-32/UCS-4. Unfortunately, this isn’t (yet) available for Windows.

    Windows builds will be narrow for a while based on the fact that there
    have been few requests for wide characters, those requests are mostly
    from hard-core programmers with the ability to buy their own Python
    and Windows itself is strongly biased towards 16-bit characters.

    Python 3.3 will have flexible string representation, in which you will not need to care about whether Unicode strings use 16-bit or 32-bit code units.

    Until then, you can get the code points from a UTF-16 string with

    def code_points(text):
        utf32 = text.encode('UTF-32LE')
        return struct.unpack('<{}I'.format(len(utf32) // 4), utf32)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to how to upgrade the default python installation(2.5.2) supplied with ubuntu 8.04
The default version of Python on Ubuntu 11.10 is 2.7, but I'm looking for
Has anybody succeeded with mod_wsgi 2.5 on Ubuntu 9.04 with default Python installation (2.6.2)?
I'm running Ubuntu to compile a set of code which requires python 2.4. How
I am running an Ubuntu 8.10, using Python 2.5 out of the box. This
Today I ran a bunch of doctests using Python 2.6 on a Ubuntu 9.10
Background: I am using Ubuntu The newer python version is not in the apt-get
On Ubuntu 10.10, I am unable to install lxml to python 2.7. Here are
After starting out with Python on Ubuntu Linux, I've now for a good while
I have Karmic Koala which has Python 2.6 installed by default. However I can't

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.