How does PHP internally represent strings?
- by Jim Thio
UTF8?
UTF16?
Do strings in PHP also keep track of the encoding used?
Let's look at this script for example. Say I run:
$original = "??????????????";
What actually happens?
Obviously I think $original will not contain just 7 characters. Those glyphs must each be represented by several bytes there.
Then I do:
$converted = mb_convert_encoding ($original , "UTF-8");
What will happen to $converted? How will $converted be different from $original?
Will it be just the exact same byte sequence as $original but with a different encoding?