What is really happening when we change encoding in a string?
- by Jim Thio
http://php.net/manual/en/function.mb-convert-encoding.php
Say I do:
$encoded = mb_convert_encoding ($original);
That looks like simple enough. WHat I am imagining is the following
$original has a pointer to the way the string is actually encoded. Something like char * kind of thing. And then there are things like what the character actually encoded.
It's probably somewhere along UTF-64 kind of thing where each glyph is indeed a character.
Now when we do
$encoded = mb_convert_encoding ($original);
several thing can happen:
the original internal representation doesn't change however it is REINTERPRETED so that the code that show up differs
the original string that it represent doesn't change however the ENCODING change.
Which one is right?