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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:34:55+00:00 2026-06-09T22:34:55+00:00

I have the string Mühle saved as Mühle in a utf8 database. I want

  • 0

I have the string Mühle saved as Mühle in a utf8 database. I want it to be in UTF8 so it will show properly on my webpage which also uses utf8.

I think the string was not converted into utf8 befor writing it into the database and now it won’t show properly on my web page.

I tried selecting this string from my mysql database and converting it into utf8, but it didn’t work. I also tried decoding it multiple times, but also that didn’t work. See the code I used for that below:

$string = Mühle;
$string=utf8_encode($string);
echo $string;

and

$string = Mühle;
$string=utf8_decode($string);
$string=utf8_encode($string);
echo $string;

The output of the above code was the same as the input in both cases, not changing anything about the string.

What can I do to convert this string in such a way that I can update it in my mysql database and when selecting it the next time it will show properly as Mühle?

  • 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-09T22:34:56+00:00Added an answer on June 9, 2026 at 10:34 pm

    Your string is double-encoded UTF-8 – that is, UTF-8 that was interpreted as Latin-1 and then re-encoded to UTF-8.

    This can happen when you mess up your character encodings – e.g. when you send UTF-8 data while your MySQL is expecting the connection to use Latin-1. To fix this, you will need to call mysqli_set_charset (or the equivalent function for your database API) as soon as you create the connection, or modify the MySQL configuration to use UTF-8 connections by default.

    Furthermore, you will need to fix your data – this is done using utf8_decode an appropriate number of times. If “Mühle” is the exact bytes returned by your database with a UTF-8 connection, you need to read that string, send it through utf8_decode, and then update that row (still using a UTF-8 connection).

    Please note that when you select a row in MySQL, it gets converted from the table character set to the connection character set before getting sent back to the client. So, if you’re seeing “Mühle” on your screen, MySQL is using a UTF-8 connection, and you’re displaying the string as UTF-8, you need to call utf8_decode twice in order to fix it, because this means the string is actually triple-encoded – twice in the database text, and once for the display. Double-check everything, preferably using a well-developed MySQL client like phpMyAdmin – until it is displayed properly there, your data is still encoded incorrectly.

    If this is only an issue with a few rows, manual fixing is okay; if it’s a general problem with your database, you might prefer to dump an SQL script, convert that file, and use it to replace your old data.

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

Sidebar

Related Questions

In MySQL I have a string, which is displayed properly in phpmyadmin, with the
I have a url string which i encode to utf8 at client side. When
I have a json string saved in my db. When i retrieve it from
I have this strings saved in my mysql database in format like: /uploads/attachments/18/105/WordPress_3_Cookbook.pdf Now,
I have one string like 8/29/2011 11:16:12 AM . I want to save in
I have string that displays UTF-8 encoded characters, and I want to convert it
I have a string in UTF8 like: Thermal Oxide: 0 Å to 40 μm
I have a model called Encryption which generates an AES encrypted string and saves
I have a mysql database that is UTF8 encoded. However, due to some previous
I have a html code which I saved in home.txt file and placed it

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.