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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:46:42+00:00 2026-05-11T18:46:42+00:00

I have a database full of names like: John Smith Scott J. Holmes Dr.

  • 0

I have a database full of names like:

John Smith  
Scott J. Holmes  
Dr. Kaplan  
Ray's Dog  
Levi's  
Adrian O'Brien  
Perry Sean Smyre  
Carie Burchfield-Thompson  
Björn Árnason

There are a few foreign names with accents in them that need to be converted to strings with non-accented characters.

I’d like to convert the full names (after stripping characters like ” ‘ ” , “-“) to user logins like:

john.smith  
scott.j.holmes  
dr.kaplan  
rays.dog  
levis
adrian.obrien  
perry.sean.smyre
carie.burchfieldthompson  
bjorn.arnason

So far I have:

Fullname.strip()  # get rid of leading/trailing white space
Fullname.lower() # make everything lower case


... # after bad chars converted/removed
Fullname.replace(' ', '.') # replace spaces with periods
  • 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-11T18:46:42+00:00Added an answer on May 11, 2026 at 6:46 pm

    Take a look at this link [redacted]

    Here is the code from the page

    def latin1_to_ascii (unicrap):
        """This replaces UNICODE Latin-1 characters with
        something equivalent in 7-bit ASCII. All characters in the standard
        7-bit ASCII range are preserved. In the 8th bit range all the Latin-1
        accented letters are stripped of their accents. Most symbol characters
        are converted to something meaningful. Anything not converted is deleted.
        """
        xlate = {
            0xc0:'A', 0xc1:'A', 0xc2:'A', 0xc3:'A', 0xc4:'A', 0xc5:'A',
            0xc6:'Ae', 0xc7:'C',
            0xc8:'E', 0xc9:'E', 0xca:'E', 0xcb:'E',
            0xcc:'I', 0xcd:'I', 0xce:'I', 0xcf:'I',
            0xd0:'Th', 0xd1:'N',
            0xd2:'O', 0xd3:'O', 0xd4:'O', 0xd5:'O', 0xd6:'O', 0xd8:'O',
            0xd9:'U', 0xda:'U', 0xdb:'U', 0xdc:'U',
            0xdd:'Y', 0xde:'th', 0xdf:'ss',
            0xe0:'a', 0xe1:'a', 0xe2:'a', 0xe3:'a', 0xe4:'a', 0xe5:'a',
            0xe6:'ae', 0xe7:'c',
            0xe8:'e', 0xe9:'e', 0xea:'e', 0xeb:'e',
            0xec:'i', 0xed:'i', 0xee:'i', 0xef:'i',
            0xf0:'th', 0xf1:'n',
            0xf2:'o', 0xf3:'o', 0xf4:'o', 0xf5:'o', 0xf6:'o', 0xf8:'o',
            0xf9:'u', 0xfa:'u', 0xfb:'u', 0xfc:'u',
            0xfd:'y', 0xfe:'th', 0xff:'y',
            0xa1:'!', 0xa2:'{cent}', 0xa3:'{pound}', 0xa4:'{currency}',
            0xa5:'{yen}', 0xa6:'|', 0xa7:'{section}', 0xa8:'{umlaut}',
            0xa9:'{C}', 0xaa:'{^a}', 0xab:'<<', 0xac:'{not}',
            0xad:'-', 0xae:'{R}', 0xaf:'_', 0xb0:'{degrees}',
            0xb1:'{+/-}', 0xb2:'{^2}', 0xb3:'{^3}', 0xb4:"'",
            0xb5:'{micro}', 0xb6:'{paragraph}', 0xb7:'*', 0xb8:'{cedilla}',
            0xb9:'{^1}', 0xba:'{^o}', 0xbb:'>>',
            0xbc:'{1/4}', 0xbd:'{1/2}', 0xbe:'{3/4}', 0xbf:'?',
            0xd7:'*', 0xf7:'/'
        }
    
        r = ''
        for i in unicrap:
            if xlate.has_key(ord(i)):
                r += xlate[ord(i)]
            elif ord(i) >= 0x80:
                pass
            else:
                r += i
        return r
    
    # This gives an example of how to use latin1_to_ascii().
    # This creates a string will all the characters in the latin-1 character set
    # then it converts the string to plain 7-bit ASCII.
    if __name__ == '__main__':
    s = unicode('','latin-1')
    for c in range(32,256):
        if c != 0x7f:
            s = s + unicode(chr(c),'latin-1')
    print 'INPUT:'
    print s.encode('latin-1')
    print
    print 'OUTPUT:'
    print latin1_to_ascii(s)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database full of text fields that look like this: (paragraph of
I have a MySQL database full of user information, like their username, password, email,
I have a database full of 70k names,addresses, etc. I also have a list
I have received this database full of people names and data in French, which
I have a database full of two-dimensional data - points on a map. Each
I have a database full of items, which should be searchable by any or
I have a database table full of time points and experimental values at those
We have an application that has a database full of polygons (currently stored as
Problem: I have a symfony project with a database full of production data I
I have a database table which is full-text indexed and i use the CONTAINS-function

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.