You are doing exactly what I was talking about. If you read the data
using the wrong encoding, then save it using the same encoding, you can
then open it using the corrent encoding, provided that the process
hasn't removed any data.
If you have set up your MySQL database to use unicode, and still get the
string out in that manner, the error is before you even saved the string
in the database in the first place. What you have done is basically:
unicode -> bytes -> wrong encoding -> MySQL -> wrong encoding -> html ->
bytes -> browser -> unicode
While this gives the correct result for some strings, some byte codes
used in UTF-8 doesn't represent a single character by themselves, so if
you contine to store mis-decoded strings as unicode, you will sooner or
later experience corrupted strings.