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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:41:01+00:00 2026-06-13T04:41:01+00:00

Once again, I am very confused with a unicode question. I can’t figure out

  • 0

Once again, I am very confused with a unicode question. I can’t figure out how to successfully use unicodedata.normalize to convert non-ASCII characters as expected. For instance, I want to convert the string

u"Cœur"

To

u"Coeur"

I am pretty sure that unicodedata.normalize is the way to do this, but I can’t get it to work. It just leaves the string unchanged.

>>> s = u"Cœur"
>>> unicodedata.normalize('NFKD', s) == s
True

What am I doing wrong?

  • 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-13T04:41:02+00:00Added an answer on June 13, 2026 at 4:41 am

    Your problem seems not to have to do with Python, but that the character you are trying to decompose (u’\u0153′ – ‘œ’) is not a composition itself.

    Check as your code works with a string containing normal composite characters like “ç” and “ã”:

    >>> a1 = a
    >>> a = u"maçã"
    >>> for norm in ('NFC', 'NFKC', 'NFD','NFKD'):
    ...    b = unicodedata.normalize(norm, a)
    ...    print b, len(b)
    ... 
    maçã 4
    maçã 4
    maçã 6
    maçã 6
    

    And then, if you check the unicode reference for both characters (yours and c + cedila) you will see that the later has a “decomposition” specification the former lacks:

    http://www.fileformat.info/info/unicode/char/153/index.htm
    http://www.fileformat.info/info/unicode/char/00e7/index.htm

    It like “œ” is not formally equivalent to “oe” – (at least not for the people who defined this unicode part) – so, the way to go to normalize text containing this is to make a manual replacement of the char for the sequence with unicode.replace – as hacky as it sounds.

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

Sidebar

Related Questions

I am very confused. How can display agreement page only once in time of
My apologies once again for asking another very junior question. For one reason or
Once again a very beginner-ish question, but here I go: I would like to
I am once again very confused and I return here for more help If
I am hoping someone can help me (once again). I have a very large
Once again a question about the garbage collector in actionscript-3: If I have a
i am very confused, once i get the access token from google to access
I'm having a very difficult time trying to figure out how to make my
Can anyone figure out a nice way to get the following code to work?
Once again, I'm at a loss with IE7 on this one. I'm making a

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.