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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:08:54+00:00 2026-05-23T02:08:54+00:00

PHP4+mySQL4 based project post to Django 1.1 project and it mixes up some letters.

  • 0

PHP4+mySQL4 based project post to Django 1.1 project and it mixes up some letters.
What is the best way (most efficient) to replace in this fashion?
The problem for me is that i cannot get values for those letters. Is there an online tool to do that?

I have textField with various letters and i want to replace those in this fashion:

àèæëáðøûþ => ąčęėįšųūž
ÀÈÆËÁÐØÛÞ => ĄČĘĖĮŠŲŪŽ

I had similar case where i had to clean up the code so i used this:

def clean(string):
     return ''.join([c for c in string if ord(c) > 31 or ord(c) in [9, 10, 13]] )

Update: i succeeded to extract Unicode values looking at Django debug messages (replace_from:replace_to):

{'\xe0':'\u0105', '\xe8':'\u010d', '\xe6':'\u0119', '\xeb':'\u0117', '\xe1':'\u012f',
 '\xf0':'\u0161', '\xf8':'\u0179', '\xfb':'\u016b', '\xfe':'\u017e',
 '\xc0':'\u0104', '\xc8':'\u010c', '\xc6':'\u0118', '\xcb':'\u0116', '\xc1':'\u012e',
 '\xd0':'\u0160', '\xd8':'\u0172', '\xdb':'\u016a', '\xde':'\u017d'

So the main problem remains – replacing

  • 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-23T02:08:55+00:00Added an answer on May 23, 2026 at 2:08 am

    Try the str.replace() method – should work with unicode strings.

    str.replace(old, new[, count])

    Return a copy of the string with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.

    Make sure your old and new strings are of type Unicode
    (that applies to your input data as well).

    Find out what your input (non-unicode) string is supposed to be encoded in.
    For example, it may be in latin1 encoding.
    Use the builtin str.decode() method to create a Unicode version of your data,
    and feed that to str.replace().

    >>> unioldchars = oldchars.decode("latin1")
    >>> newdata = data.replace(unioldchars, newchars)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a legacy web application php4/mysql4 (MyISAM, db contains some cms, some user
I have a legacy web application php4/mysql4 (MyISAM, db contains some cms, some user
I've taken over a mixed PHP4/PHP5 project which has been handed down from developer
I have come across an annoying problem while writing some PHP4 code. I renamed
What are some good steps to follow for a smooth migration from PHP4 to
I am migrating from PHP4 to PHP5 I have this in my .htaccess: php_flag
I call my site this way locally: http://localhost:80/mysite/de/layer1/layer2/module In .htaccess I have: RewriteEngine on
Does PHP 4.4.8 version support mysqli object-oriented style? I have made ready this project
We're moving from php4 to php5, and we get this warning on one of
in PHP4 there is no public,private,etc. So I am wondering if there is some

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.