MySQL: Why is the `length` (byte length) of a string in a `varchar` field shorter than the actual string? I'm sure there's a really obvious answer but: 

Why is the length (byte length) of a string in a varchar field shorter than the actual string?

e.g. 

CREATE TABLE `test1` (
  `testdata` varchar(4) DEFAULT NULL
) CHARSET=latin1;

insert into test1 (`testdata`) VALUES('ÂÂÂÂ');

select 
    testdata,
    length(testdata),
    char_length(testdata),
    length('ÂÂÂÂ'),
    char_length('ÂÂÂÂ')
from test1

**result:**
testdata: ÂÂÂÂ
length: 4
char_length: 4
length: 8
char_length: 4
The table character set is different to your client character set. So when you type 'ÂÂÂÂ' into your client, you are referring to a different string than the result of select testdata from test1; When you ran insert into test1 (testdata) VALUES('ÂÂÂÂ'); there was an implicit conversion to the latin1 charset, which only needs 1 byte per character for the string. No such conversion happens when you type length('ÂÂÂÂ') into your client.